<template>
	<view class="container" @click="hideCal">
		<!-- 取消约餐 -->
		<uni-popup ref="pop3" class="uni-propun-con" :safeArea="false" zindex>
			<view class="popup-content  padding-lr">
				<view class="uni-dialogCon">
					<view class="belivery-title padding-top text-bold text-c0 text-xl  text-center">取消约餐</view>
					<view class="">
						<view class="mainbox">
							<view class="martB" :class="{ol:cancelData.length<=0}">确定取消本次约餐么？</view>
							<view class="flex align-center justify-between flex-wrap">
								<view class="flex align-center listyuecan " v-for="(item,index) in cancelData"
									:key="index" @click="tabRadioSel(item)">
									<text class="csico text-xxl margin-right-xxs"
										:class="item.state?'.cuIcon-roundcheckfill':'cuIcon-round'"></text>
									<text class="textprop">{{item.text}}</text>
								</view>
							</view>
						</view>
					</view>
					<view class="popupEmil-btn  flex justify-between align-center">
						<view class="mdbtn text-acenter text-ngreen" @click="hidePop('pop3')">我点错了</view>
						<view class="mdbtn text-acenter" @click="tapCancelModal">我要取消</view>
					</view>
				</view>
			</view>
		</uni-popup>
		<!-- 修改约餐提示 -->
		<uni-popup ref="editProp" type="center" zindex>
			<view class="meal-prop-con">
				<view class="meal-title">提示</view>
				<view class="meal-text flex flex-direction">
					<text>如需变更送餐时间或地址</text>
					<text>请在送餐前2小时完成修改</text>
				</view>
				<view class="meal-btn flex justify-center align-center" @click="hidePop('editProp')">我知道了</view>
			</view>
		</uni-popup>
		<!-- 约餐弹窗 -->
		<setAutoMeal ref="pop1" :source="'appionted'" @confirm="sureAuto"></setAutoMeal>
		<!-- 定制弹窗-规格选择@change="changeModalNum" -->
		<speciModal ref="pop2" @confirm="confirmModalNum" :actionfn="cacheListGroups" @delItem="modalDel"></speciModal>
		<!-- 设置约餐弹窗 -->
		<setMealsModal ref="pop4" :goodsId="curGoodsId" :fbillId="fbillId" :mealsName="mealDetail.name"></setMealsModal>


		<!-- 请设置自动约餐 -->
		<!-- <uni-popup ref="mealMate" type="bottom" zindex>
			<view class="mealMate-con">
				<view class="mate-title flex justify-between align-center">
					<text>请设置自动约餐</text>
					<text v-if="setDetails.startDate">{{transdTime(setDetails.startDate)}}开始</text>
				</view>
				<view class="meal-drop">
					<view class="dizhi-bg">
						<view class="textdizhi">送餐地址</view>
					</view>
					<view class="dizhi-con"
						@click="mnavTo('/pages/others/addressList/addressList?source=manyMeals' + '&adressInfo=' + setedAddress.naddress_id )">
						<block v-if="setedAddress.adrs">
							<view class="flex justify-between align-center marbom">
								<text class="dzhi-font">
									{{ setedAddress.adrs }}
								</text>
								<text class="fcon-Vector mores_icons" style="margin-right: -10rpx;"></text>
							</view>
							<view class="dzhi-font99">
								<text>{{setedAddress.vname}}</text>
								<text>{{plusXing(setedAddress.vphone,3,4) }}</text>
							</view>
						</block>
						<view v-else class="flex align-center padding-bottom-xs">
							<view class="flex-sub">请选择配送地址</view>
							<text class="cuIcon-right"></text>
						</view>
					</view>
				</view>
				<view class="meal-drop">
					<view class="dizhi-bg">
						<view class="textdizhi">约餐方式</view>
					</view>
					<view class="set_meals flex  align-center flex-wrap">
						<view class="flex set_meals_li align-center flex-direction justify-center"
							v-for="(item,index) in mealsList" :class="{hoverSet : item.id == mealsClass}"
							@tap="tapItemSelecMeal(item,index)" :key="index">
							<text class="meals_font" :class="{mealsfonthover:item.id == mealsClass}">{{ item.name }}</text>
							<text class="text-mels" :class="{textfonthover:item.id == mealsClass}">{{item.dis||item.text}}</text>
							<text class="posi-icon flex" v-if="item.id == mealsClass">
								<text class="posi-check fcon-xuanzhong"></text>
							</text>
						</view>
					</view>
				</view>
				<view class="titps-text">
					如需变更送餐时间或地址，请在送餐前2小时完成修改。
				</view>
				<view class="titps-btn flex align-center justify-center" @click="confirmSet">
					确定
				</view>
			</view>
		</uni-popup> -->
		<!-- 配送时段 -->
		<!-- <uni-popup ref="deliveryTime" type="bottom" zindex @maskClick="maskClick">
			<view class="comBotBx" @click.stop="closeall">
				<view class="mtitle text-xll  prpo-w padding-lr">
					请设置配送时段
				</view>
				<view class="bg-white nav padding-lr prpo-w marbittom">
					<view class="flex flex-wrap">
						<view v-for="(item,index) in mealData" :key="index"
							class="cu-items p_rlt text-lg point flex flex-direction"
							:class="index==tabClass?'act':''" @click.stop="selecyucan(item,index)"
							:data-id="index">
							{{item.name}}
							<text class="margin-top-xs" v-if="item.setedTime">{{ item.setedTime}}</text>
							<view class="seleIcon">
								<view class="triangle" :class="index==tabClass?'seleBgActive':''"></view>
								<text class="checkmark"></text>
							</view>
							<view class="yytips flex flex-direction" v-if="item.state&&item.time">
								<view class="yytips_li flex justify-between"
									v-for="(citem,cindex) in item.time"
									@click.stop="selecTips(citem,item.time,item)" 
									:key="cindex">
									<text class="fongStyle">{{citem.text}}</text>
									<text class=" text-xll" :class="citem.flag?'cuIcon-roundcheckfill':'cuIcon-round'"></text>
								</view>
							</view>
						</view>
					</view>
				</view>
				<view class="padding-lr zdypadding flex justify-between flex-direction">
					<view class="zm_half bg" @click="determine">
						确定
					</view>
				</view>
			</view>
		</uni-popup> -->

		<view class="topSec p_rlt padding-lr text-white">
			<view class="tc_name padding-top-lg flex align-center">
				<view class="flex-sub text-bold">{{mealDetail.name||''}}</view>
				<view v-if="mealDetail&&mealDetail.goods_id" class="flex align-center text-df padding-left-sm"
					@click="tapShopItem">
					详情<text class="cuIcon-right text-sm margin-left-xxs"></text>
				</view>
			</view>
			<view class="padding-top-sm text-sm">
				{{mealDetail.vintroduction||''}}
			</view>

		</view>
		<!-- 原 -->
		<!-- <swiper class="screen-swiper square-dot" :indicator-dots="true" :circular="true" :autoplay="true"
			interval="5000" duration="500">
			<swiper-item v-for="(item,index) in mealDetail.detailImgList" :key="index">
				<image :src="imgBaseUrl + item" mode="aspectFill"></image>
			</swiper-item>
		</swiper>
		<view class="ms_test padding-left padding-top padding-bottom-sm p_rlt">
			<view class=" flex align-center">
				<view class="flex-sub">
					{{mealDetail.name||''}}
				</view>
				<view class="padding-tb-xs padding-lr-lg point" @click="tapShopItem">
					详情<text class="cuIcon-right text-sm margin-left-xxs"></text>
				</view>
			</view>
			<view class="padding-tb-xs padding-right" style="padding-bottom: 30rpx;">
				{{mealDetail.vintroduction||''}}
				21天餐再次新升级!种类更丰富，只为给你更好的轻负控卡生活!每天少跑7公里！
			</view>
		</view> -->
		<!-- 自动约餐 -->
		<view v-if="hasRecord" class="p_rlt recBox">
			<view class="automatic_con">
				<view class="flex justify-between align-center leMeal_title paddingdzih">
					<view class="textgd padding-tb-sm point" @click.stop="tapToggleCal">
						我的约餐
						<text class="fcon-Vector mores_icons  rotateStyle" :class="{rotateStyleHover : showCad}"></text>
					</view>
					<view>
						<text class="mores" @click="tapShowSet">设置自动约餐
							<text class="fcon-Vector mores_icons"></text>
						</text>
					</view>
				</view>
				<!-- 默认展示-周 -->
				<view class="weekend flex justify-between align-center paddingxxx p_rlt" v-if="!showCad"
					:class="{rotateStyleHover : showCad}">
					<!-- 详情弹窗 -->
					<!-- showCalSub -->
					<!-- <uni-transition style="z-index: 66;" :mode-class="['fade','slide-top']" :show="showWkSub"> -->
					<view class="calenSubFixed text-white" :class="{show:showWkSub}"
						:style="{top:tapcaly+'px',height:(showWkSub?wkSubBoxH:0) + 'px'}">
						<view class="csfmain p_rlt">
							<text class="jtbox" :style="{left:tapcalx+'px'}"></text>
							<block v-for="(item,index) in calMealDetail" :key="index">
								<view class="flex align-center text-lg padding-tb-xs">
									<view class="flex-sub text-bold">
										{{item.rangeTpye=='1186'?'早餐':item.rangeTpye=='1187'?'中餐':item.rangeTpye=='1188'?'晚餐':''}}
										(<text><text class="text-bold text-lg">{{item.totalEnergy||'0'}}</text><text
												style="font-weight: normal;">Kcal</text></text>)
									</view>
									<view class="padding-right sizipic">
										<text class="ionc_pic">￥</text>{{item.ntotal_money||''}}
									</view>
								</view>
								<view class="clm_cont">
									<view v-for="(citem,cindex) in item.goodsNutrientsList" :key="cindex"
										class="flex align-center cpdmin">
										<view class="flex-sub">
											{{citem.goodsName||''}}
										</view>
										<view class="">
											{{citem.energy||'0'}}kcal
										</view>
									</view>
								</view>
							</block>
							<view class="flex align-center csb_bt">
								<view class="flex align-center text-lg" @click.stop="tapToOrderList">查看订单<text
										class="cuIcon-right text-xs"></text></view>
								<view class="flex-sub text-xl text-end">{{calDetailTmoney}}</view>
							</view>
						</view>
					</view>
					<!-- </uni-transition> -->
					<view class="listUl flex justify-center align-center flex-direction" v-for="(item,index) in weekend"
						:key="index" @click.stop="tapCalItem(item,index,$event,'week')">
						<!-- isToday 吃过了 0  1 预约了  2待预约  986 可约 987 已约 988 完成了 tapWItem  getClassNew(item.status,item.actnums)-->
						<view class="borderLi flex justify-center align-center"
							:class="{ bgHover: item.status == '987',act: curDate&&curDate == item.sxp_date,fontSizes: item.status == '987',gry:!item.status,ov:item.status == '988',border999: item.status == '986'}">
							<!-- &&isPerfect(item.total_nums,item.can_pre_morning_nums||0,item.can_pre_noon_nums||0,item.can_pre_night_nums||0) -->
							<text v-if="item.status == '988'" class="cuIcon-check wcbox text-xl text-bold"></text>
							<text v-else-if="item.status == '987'" class="text-xs">已约</text>
							<!-- <text v-else-if="item.status=='988'&&item.total_nums>0" class="">{{item.total_nums}}</text> -->
							<!-- !item.status||item.status == '986' -->
							<text v-else>{{item.week||''}}</text>
						</view>
						<!-- :class="{'text-bold':(item.isToday==='true'||item.isToday===true)}" -->
						<view class="timeweek">
							{{item.isToday==='true'||item.isToday===true?'今天':item.day}}
						</view>
					</view>
				</view>
				<!-- 日历 :animation="animationCal"-->
				<view class="mcalendbx p_rlt" :class="{show:showCad,lg:filcalen}" :style="calStyle">
					<view class="mcalCont">
						<view v-if="curMonth" class="mothbox text-sm text-c6">
							<view class="border_bootom flex justify-between align-center">
								<text class="curMonth_style"> {{curMonth}}月</text>
								<view>
									<text class="yuan"></text>
									<text>已约餐：{{mtotalParams.total_nums||0}}次</text>
								</view>
								<view>
									<text class="yuan"></text>
									<text>卡路里：{{mtotalParams.total_energy||0}}Kcal</text>
								</view>
								<view>
									<text class="yuan"></text>
									<text>消费：￥{{mtotalParams.total_money||0}}</text>
								</view>
							</view>
						</view>
						<view class="mcdbox p_rlt">
							<!-- state.tapcaly ,right:curSelect.week=='日' calMealDetail-->
							<view class="calenSubFixed text-white" :class="{show:showCalSub}"
								:style="{top:tapcaly+'px',height:(showCalSub?wkSubBoxH:0) + 'px'}">
								<view class="csfmain p_rlt">
									<text class="jtbox" :style="{left:tapcalx+'px'}"></text>
									<block v-for="(item,index) in calMealDetail" :key="index">
										<view class="flex align-center text-lg padding-tb-xs">
											<view class="flex-sub text-bold">
												{{item.rangeTpye=='1186'?'早餐':item.rangeTpye=='1187'?'中餐':item.rangeTpye=='1188'?'晚餐':''}}(<text><text
														class="text-bold text-lg">{{item.totalEnergy||'0'}}</text><text
														style="font-weight: normal;">Kcal</text></text>)
											</view>
											<view class="padding-right sizipic">
												<text class="ionc_pic">￥</text>{{item.ntotal_money||''}}
											</view>
										</view>
										<view class="clm_cont">
											<view v-for="(citem,cindex) in item.goodsNutrientsList" :key="cindex"
												class="flex align-center cpdmin">
												<view class="flex-sub">
													{{citem.goodsName||''}}
												</view>
												<view class="">
													{{citem.energy||'0'}}kcal
												</view>
											</view>
											<!-- <view class="flex align-center cpdmin">
												<view class="flex-sub">
													甜玉米1根
												</view>
												<view class="">
													103kcal
												</view>
											</view>
											<view class="flex align-center cpdmin">
												<view class="flex-sub">
													纯牛奶一杯
												</view>
												<view class="">
													66kcal
												</view>
											</view> -->
										</view>
									</block>
									<view class="flex align-center csb_bt">
										<view class="flex align-center text-lg" @click.stop="tapToOrderList">
											查看订单<text class="cuIcon-right text-xs"></text></view>
										<text class="flex-sub text-xl text-end">{{calDetailTmoney}}</text>
									</view>

									<!-- <view class="flex align-center text-lg padding-tb-xs">
						
										<view class="flex-sub text-bold">
											中餐 (<text><text class="text-bold text-lg">308</text><text
													style="font-weight: normal;">Kcal</text></text>)
										</view>
										<view class="padding-right sizipic">
											<text class="ionc_pic">￥</text>35.00
										</view>
						
									</view>
									<view class="clm_cont">
										<view class="flex align-center cpdmin">
											<view class="flex-sub">
												橄榄油老姜云耳炒鸡100g
											</view>
											<view class="">
												207kcal
											</view>
										</view>
										<view class="flex align-center cpdmin">
											<view class="flex-sub">
												橄榄油水芹炒百合100g
											</view>
											<view class="">
												131kcal
											</view>
										</view>
										<view class="flex align-center cpdmin">
											<view class="flex-sub">
												橄榄油自灼生菜100g
											</view>
											<view class="">
												37kcal
											</view>
										</view>
									</view>
						
									<view class="flex align-center text-lg padding-tb-xs">
						
										<view class="flex-sub text-bold">
											晚餐 (<text><text class="text-bold text-lg">359</text><text
													style="font-weight: normal;">Kcal</text></text>)
										</view>
										<view class="padding-right sizipic">
											<text class="ionc_pic">￥</text>28.00
										</view>
									</view>
									<view class="clm_cont">
										<view class="flex align-center cpdmin">
											<view class="flex-sub">
												五红粥300g
											</view>
											<view class="">
												208kcal
											</view>
										</view>
										<view class="flex align-center cpdmin">
											<view class="flex-sub">
												橄榄油热拌鸡蛋干100g
											</view>
											<view class="">
												151kcal
											</view>
										</view>
									</view> -->
								</view>
							</view>
							<!-- <view v-for="index in 5" :key="index" class="mcitm"></view> -->
							<swiper class="swiperBox" @change="calenderSwiper" :current="curSwiperIndex"
								:class="{ lg: filcalen }" :indicator-dots="false" :autoplay="false"
								:circular="swcircular">
								<swiper-item v-for="(fitem,findex) in swiperList" :key="findex">
									<view class="padding-top-xxs">
										<!-- calenList -->
										<view v-for="(item,index) in fitem" :key="index" class="mcitm text-center"
											@click.stop="tapCalItem(item,index,$event)">
											<block v-if="item.day">
												<view class="d_ib">
													<view class="mcsub text-sm p_rlt text-acenter"
														:class="{def:item.isdefault,ngreen:item.status == '987',grey:!item.status,ov:item.status == '988',act: curDate&&curDate == item.sxp_date }">
														<!-- //吃过了 0  1 预约了  2待预约 rlClass==index-->
														<!-- <tetx v-if="item.state == 0 && item.actnum!=3">{{item.actnum}}</tetx>
														<tetx v-if="item.actnum ==3" class="cuIcon-check text-xl"></tetx>
														<tetx v-if="item.state == 1">约</tetx>
														<text v-if="item.state == 2">{{item.name}}</text> -->
														<!-- 986 可约 987 已约 988 完成了 -->
														<text v-if="item.status == '988'"
															class="cuIcon-check wcbox text-xl text-bold"></text>
														<tetx v-else-if="item.status == '987'" class="text-xs">已约</tetx>
														<!-- ||item.status == '987'&&item.total_nums>0 -->
														<!-- <text v-else-if="item.status=='988'&&item.total_nums>0" class="">{{item.total_nums}}</text> -->
														<text v-else>{{item.week||''}}</text>
														<!-- <text>{{item.state}}</text> -->
													</view>
												</view>

												<view class="mcnum text-xs text-c9"
													:class="{'text-bold':(item.isToday==='true'||item.isToday===true)}">
													{{item.isToday==='true'||item.isToday===true?'今天':item.day}}
												</view>
											</block>
											<view v-else class="mcitm"></view>
										</view>
									</view>
								</swiper-item>
							</swiper>

						</view>
					</view>
				</view>
				<view class=" leMeal_title bg_container" @touchstart="modalTouchStart" @touchmove="modalTouchMove" @touchend="modalTouchEnd">
					<view class="flex justify-between align-center">
						<image v-if="!showCad" class="posiImg" :class="'lef' + weekClass"
							src="../../../static/yuding.png" mode=""></image>
						<view class="textgd">今日菜单推荐</view>
						<view class="flex align-center" @click.stop="selecTab(indexFlag==0?1:0)">
							<text class="text-c9 margin-right-xxs "
								:class="indexFlag==0?'fcon-liebiao':'fcon-shuanglieliebiao'"></text>
							<text class="">{{indexFlag==0?'菜名点菜':'看图点菜'}}</text>
						</view>
					</view>
					<view>
						<tabs ref="tabsRef" :list="navlist" @tabItemClick="tabSelect" :current="navClass"
							marright="10rpx" activeWeight='400' fontSize="32rpx" activeColor="#53A87F"
							activeBarColor="#53A87F" barHeight="2"></tabs>
					</view>
				</view>
			</view>
		</view>
		<!-- <view  v-if="!hasRecord" class="flex justify-between align-center leMeal_title bg_container">
			<image v-if="!showCad" class="posiImg" src="../../../static/yuding.png" mode=""></image>
			<view class="textgd">今日菜单推荐</view>
			<view class="flex align-center" @click="selecTab(indexFlag==0?1:0)">
				<text class="text-c9 margin-right-xxs "
					:class="indexFlag==0?'fcon-liebiao':'fcon-shuanglieliebiao'"></text>
				<text class="">{{indexFlag==0?'菜名点菜':'看图点菜'}}</text>
			</view>
		</view> -->
		<!-- <slideContent initTop="300" :disable="false" minTop="600" maxTop="800" ref="sildContRef"> -->
		<!-- <template v-slot:contents> -->
		<view class="cenSec">
			<!-- <view class=" leMeal_title bg_container">
				<view class="flex justify-between align-center">
					<image v-if="!showCad" class="posiImg" :class="'lef' + weekClass"
						src="../../../static/yuding.png" mode=""></image>
					<view class="textgd">今日菜单推荐</view>
					<view class="flex align-center" @click.stop="selecTab(indexFlag==0?1:0)">
						<text class="text-c9 margin-right-xxs "
							:class="indexFlag==0?'fcon-liebiao':'fcon-shuanglieliebiao'"></text>
						<text class="">{{indexFlag==0?'菜名点菜':'看图点菜'}}</text>
					</view>
				</view>
				<view>
					<tabs ref="tabsRef" :list="navlist" @tabItemClick="tabSelect" :current="navClass"
						marright="10rpx" activeWeight='400' fontSize="32rpx" activeColor="#53A87F"
						activeBarColor="#53A87F" barHeight="2"></tabs>
				</view>
			</view> -->
			<!-- :style="ind === 0 ? computedStyle : ''" -->
			<view class="singleMeal_box" :class="{'singleMeal_box_bg':indexFlag==1,gry:loaded&&sxpGroupList.length==0}">
				<view v-if="loaded&&sxpGroupList.length==0" class="emptybx text-acenter text-c9 text-lg">
					暂无约餐数据
				</view>
				<block v-for="(it,ind) in sxpGroupList" :key="ind">
					<!-- 图片版 -->
					<block v-if="indexFlag==0">
						<view class="leMeal_title flex justify-between align-center">
							<view class="textgd">{{it.vname||''}}
							</view>
							<!-- <view class="swtich_menu flex justify-between align-center" v-if="ind === 0 && !hasRecord">
								<text class="font_style flex align-center justify-center" v-for="(item,index) in mealTitle"
									:key="index" @click="selecTab(index)"
									:class="{active : indexFlag == index}">{{item.text}}</text>
							</view> -->
							<view v-if="ind === 0 && !hasRecord" class="flex align-center"
								@click="selecTab(indexFlag==0?1:0)">
								<text class="text-c9 margin-right-xxs "
									:class="indexFlag==0?'fcon-liebiao':'fcon-shuanglieliebiao'"></text>
								<text class="">{{indexFlag==0?'菜名点菜':'看图点菜'}}</text>
							</view>
							<block v-else>
								<view v-if="it.is_add_goods=='5'&&submiType.status=='ky'">
									<text class="mores" @click="getMores(it)">更多<text
											class="fcon-Vector mores_icons"></text></text>
								</view>
							</block>

						</view>
						<view class="list_img bg flex justify-start flex-wrap">
							<!-- d_ib -->
							<view class="flex flex-direction mitem padding-top-sm" v-for="(item,index) in it.specList"
								:key="index">
								<view class="flex-sub">
									<view class="img_style text-center" @click="handelPre(it.specList,index,item)">
										<!-- <image class="img_wh" :src="item.img" mode=""></image> specList tabList  :fade="false" :lazyLoad="false" -->
										<tb-image width="180rpx" height="180rpx" borderRadius="30rpx"
											:src="imgBaseUrl + (item.vimage||item.vmaster_product_image_id||'')">
											<template v-slot:error>
												<image src="../../../static/menuEmpty.png" class="img_wh"
													mode="aspectFill">
												</image>
											</template>
										</tb-image>
										<view class="goods_removeds" v-if="item.sku_status!='233'||item.nsell_nums<=0">
											{{item.nsell_nums<=0?'已售罄':'已下架'}}
										</view>
										<!-- <view class="specifications" v-if="!indexFlag">
											{{item.vname||''}}
										</view>
										<view class="lock_icon_Vimg" v-if="item.isLock">
											<text class="fcon-a-Frame427321310"></text>
										</view> -->
									</view>
									<view class="text_name padding-top-xs text-center">{{item.goodsname||''}}</view>
									<view class="text_pic_con text-center padding-top-xs">
										<view class="text_price">
											<block
												v-if="curSingleMealType!='1175'&&(item.showPrice&&item.is_default_buy!='5'||!item.showPrice)">
												<text v-if="item.showPrice!=null"
													class="text-xs">{{item.isPosPrice?'+':'-'}}</text>
												<text :style="{ fontSize:'20rpx'}">￥</text>
												<text>{{item.showPrice!=null?item.showPrice:(shopStore.costPlan == '1130' ? item.sxp_site_sell_price : item.sxp_out_sell_price)}}</text>
												<text>/</text>
												<!-- {{item.activity ? item.activity_price : (shopStore.costPlan == '1130' ? item.sxp_site_sell_price : item.sxp_out_sell_price)}}/ -->
											</block>
											<text class="text-c9 text-sm">
												{{item.vname||''}}
											</text>
										</view>
										<!-- <view class="numBox">
											<text class="csico text-xxl" v-if="!item.isLock" @tap="tapItemSelec(item)"
											:class="item.select?'.cuIcon-roundcheckfill':'cuIcon-round'"></text>
											<view v-else class="lock_icon">
											  <text class="fcon-a-Frame427321310"></text>
											</view>
											<uni-number-box @changes="changeNum" v-model="item.num" :sku="item" :max="item.isLock?1:999"
												:disabled="item.isLock?true:false" />
										</view> -->
									</view>
								</view>
								<view class="numBox flex justify-end margin-top-xs">
									<view v-if="item.isLock" class="lkbox text-acenter">
										<view class="lock_icon_Vimg d_ib">
											<text class="fcon-a-Frame427321310"></text>
										</view>
									</view>
									<uni-number-box v-else @changes="changeNum" allowInput fontSize="36rpx"
										v-model="item.num" :step="item.num<=0?item.sminNums:1" :sku="item"
										:min="item.isMust?item.sminNums:0" :nstash="item.num>0&&item.num>=item.sminNums"
										:max="(item.smaxNums>=item.fmaxNums?item.fmaxNums:item.smaxNums)"
										:disabled="submiType.status!='ky'||item.sku_status!='233'||item.nsell_nums<=0" />
									<!-- getSmaxNum(item)最大数：需根据当前组的商品总数与组允许的最大数动态变化 -->
								</view>
							</view>
						</view>
					</block>
					<!-- 文字版 -->
					<block v-else>
						<view class="leMeal_title flex justify-between align-center">
							<view class="textgd">{{it.vname||''}}</view>
							<!-- <view class="swtich_menu flex justify-between align-center" v-if="ind == 0 && !hasRecord">
								<text class="font_style flex align-center justify-center" v-for="(item,index) in mealTitle"
									:key="index" @click="selecTab(index)"
									:class="{active : indexFlag == index}">{{item.text}}</text>
							</view> -->
							<view v-if="ind == 0 && !hasRecord" class="flex align-center"
								@click="selecTab(indexFlag==0?1:0)">
								<text class="text-c9 margin-right-xxs"
									:class="indexFlag==0?'fcon-liebiao':'fcon-shuanglieliebiao'"></text>
								<text class="">{{indexFlag==0?'菜名点菜':'看图点菜'}}</text>
							</view>
							<view v-else>
								<text v-if="it.is_add_goods=='5'&&submiType.status=='ky'" class="mores"
									@click="getMores(it)">更多<text class="fcon-Vector mores_icons"></text></text>
							</view>
						</view>
						<view class="list_img flex justify-start flex-wrap">
							<view class="flex flex-direction margin-right zitem " v-for="(item,index) in it.specList"
								:key="index"
								:class="{act:item.num && !item.isLock,gry:getSmaxNum(item)<=0||item.sku_status!='233'||item.nsell_nums<=0}">

								<view class="flex justify-center list_border align-center p_rlt"
									@click="selecList(item,index,it.specList)"
									:class="{ activeList: item.num && !item.isLock }">

									<view @click.stop="handelPre(it.specList,index,item)">
										<tb-image width="40rpx" height="40rpx" borderRadius="20rpx"
											:src="imgBaseUrl + (item.vimage||item.vmaster_product_image_id||'')">
											<template v-slot:error>
												<image src="../../../static/menuEmpty.png" class="text_img"
													mode="aspectFill">
												</image>
											</template>
										</tb-image>
										<!-- <image class="text_img" :src="item.img" lazy-load mode="aspectFill"></image> -->
									</view>
									<view class="flex-sub text-cut spctext">
										<text class="text_marleft">{{item.goodsname||''}}</text>
										<text
											:class="{text_marleft: item.sku_status!='233'||item.nsell_nums<=0}">{{item.vname||''}}</text>
									</view>
									<view class="goods_removeds_text" v-if="item.sku_status!='233'||item.nsell_nums<=0">
										{{item.nsell_nums<=0?'已售罄':'已下架'}}
									</view>
									<view class="text_price" v-if="curSingleMealType!='1175'&&item.is_default_buy!='5'">
										<text v-if="item.showPrice!=null"
											class="text-xs">{{item.isPosPrice?'+':'-'}}</text>
										<text :style="{ fontSize:'32rpx'}">￥</text>
										<text>{{item.showPrice!=null?item.showPrice:(shopStore.costPlan == '1130' ? item.sxp_site_sell_price : item.sxp_out_sell_price)}}</text>
									</view>
									<view v-if="item.isLock" class="lock_icon lock_icon_posi">
										<text class="fcon-a-Frame427321310"></text>
									</view>
									<uni-badge class="uni-badge-left-margin total" :text="item.num" absolute="rightTop"
										:offset="[0, -23]" size="normal">
									</uni-badge>
								</view>
							</view>
						</view>
					</block>
				</block>
			</view>
		</view>
		<!-- </template> -->

		<!-- </slideContent> -->



		<!-- 原 -->
		<!-- <view v-if="false" class="centSec lh_z padding-bottom p_rlt" v-for="(it,ind) in mealList" :key="ind"
			style="border: 1px solid red;">
			<view class="padding-top-xs">
				<view class="cstit text-lg flex align-center text-bold padding-top justify-between">
					<text class="margin-left-xs">{{it.tabName}}</text>
					<text class="mores" @click="getMores" v-if="ind==0">更多<text
							class="fcon-Vector mores_icons"></text></text>
				</view>
				<view class="cslist flex flex-wrap">
					<view v-for="(item,index) in it.tabList" :key="index" class="d_ib clitm margin-top-sm"
						@click="tapItemSelec(item)">
						<view class="climgbx">
							<image class="climg" :src="'https://cdn-static.yekjx.com/'+item.img" lazy-load
								mode="aspectFit"></image>
						</view>
						<view class="">
							<view class="padding-top-xs padding-lr-xs text-cuts">
								{{item.name}}
							</view>
							<view class="text-sm text-c6 margin-top-xxs padding-lr-xs text-cuts">
								{{item.dis1}}<text class="csdian text-df"></text>
							</view>
							<view class="csbtnbx flex align-center justify-between padding-lr-sm margin-top-sm">
								<view class="price_text">
									<text v-if="ind!=0">+</text><text class="price_text_y">¥</text>{{item.price}}
								</view>
								<view>
									<text class="csico text-xxl" v-if="!item.isLock"
										:class="item.select?'.cuIcon-roundcheckfill':'cuIcon-round'"></text>
									<view v-else class="lock_icon">
										<text class="fcon-a-Frame427321310"></text>
									</view>
								</view>

							</view>
						</view>
					</view>
				</view>
			</view>
		</view> -->
		<view v-if="curStatus&&loaded&&sxpGroupList.length>0&&(submiType.status=='ky'||submiType.name)"
			class="bot_padbox"></view>
		<!-- &&curAddLists.length -->
		<view v-if="curStatus&&loaded&&sxpGroupList.length>0&&(submiType.status=='ky'||submiType.name)"
			class="meal_botbx padding-top-xs" :class="{lowz:showCalSub||showWkSub}">
			<view class="bot_main" :class="{scemt:curAddLists.length<=0}">
				<view class="bmtop">
					<view class="bmtbox">
						<!-- loaded&&selecttData.sList.length>0 -->
						<view v-if="curAddLists.length>0" class="padding-left flex align-center text-white text-sm">
							<text class="flex-sub">已选餐品</text>
							<view class="padding-tb-xxs padding-lr" @click="tapClearCar">
								<text class="cuIcon-delete"></text>
								清空
							</view>
						</view>
						<view class="flex shuline p_rlt"
							:class="{hdl:!sxpGroupList||sxpGroupList.length<=0||(submiType.status!='ky')}">
							<scroll-view scroll-x="true" class="bot_scr">
								<view v-if="curAddLists.length<=0" class="padding-left">
									<view class="btitm p_rlt">
										<view class="btimg text-acenter"><text class="cuIcon-add text-white"></text>
										</view>
										<view class="btmsbx text-center text-xs">
											<view class="btcont text-acenter text-white d_ib">
												x0
											</view>
										</view>
									</view>

								</view>
								<view v-else class="mnav padding-left">
									<view v-for="(item,index) in curAddLists" :key="index" class="btitm p_rlt"
										@click="showPop('pop2',item)">
										<uni-transition :mode-class="['fade', 'slide-right']" :show="item.nums>0">

											<view v-if="!item.isMust" class="bttip text-acenter"
												@click.stop="delCarItem(item)">
												<text :class="item.disabled?'fcon-a-jiesuo11':'fcon-a-close'"></text>
											</view>

											<!-- imgBaseUrl + item.img||'' -->
											<!--  <image class="btimg" :src="env.FileUrl + item.img" mode="aspectFill"></image> -->
											<!-- <image class="btimg" :src="item.img" mode="aspectFill"></image> -->
											<tb-image width="92rpx" height="92rpx" borderRadius="10rpx"
												:src="imgBaseUrl+item.img">
												<template v-slot:error>
													<image src="../../../static/menuEmpty.png" class="btimg"
														mode="aspectFill"></image>
												</template>
											</tb-image>
											<view class="btmsbx text-center text-xs">
												<view class="btcont text-acenter text-white d_ib"
													:class="{kx:item.type=='dz'}">
													<block v-if="item.type=='dz'">
														定制
													</block>
													<block v-else-if="item.isLock">
														<text class="fcon-a-Frame427321310"></text>
													</block>
													<block v-else>
														x{{item.nums||0}}
													</block>
												</view>
											</view>
										</uni-transition>
									</view>
								</view>
							</scroll-view>
							<view v-if="submiType.status=='ky'" class="add_menu" @click.stop="getMores">
								<text class="cuIcon-add menu_icons"></text>
								<text class="menu_add_text">加菜</text>
							</view>
						</view>
					</view>
				</view>
				<view class="bmbot flex align-center padding-right">
					<view class="bmlef flex-sub text-center text-white p_rlt">
						<view class="total_moneys">
							<!-- selecttData -->
							<text class="moneys_front">¥</text>{{calcData.totPayMoney}}
						</view>
						<!-- <view class="total_reduce">¥{{selecttData.totalMoney}}</view> -->
					</view>
					<view v-if="loaded&& curAddLists.length<=0" class="text-xll text-center text-white">
						{{!submiType.status&&submiType.name?submiType.name:'请选择餐品'}}
					</view>
					<block v-else>
						<view v-if="submiType.name" class="bmsubbtn" @click="tapSubmit"
							:class="{gry:submiType.status=='ov'||!submiType.status}">
							{{submiType.name}}
							<!-- {{submiType=='ky'?'约餐':submiType=='qx'?'取消':submiType=='ov'?'已用餐':''}} -->
						</view>
					</block>

				</view>
			</view>
		</view>
		<!-- <dragButtons :changeX="changeDrag" :showStatus="showNav" isDock @btnTouchend="dragTouchend" :existTabBar="true"
			:maxWidth="644">
			<view class="dragMain" :class="{show:showNav}">
				<view class="expend_box">
					<view class="text-cuts">
						<view class="p_rlt d_ib text-center padding-lr-xs exitem">
							<view class="an_icons" :style="getClass()" @click.stop="tapToggleDrag()">
								<text class="fcon-shouqi" style="color:#FF9307;font-size: 16rpx;"></text>
							</view>
							<view class="ex_top flex flex-direction justify-center align-center"
								@click.stop="tapToggleDrag()">
								<view class="fn_toCal">{{suBtnKcal}}</view>
								<view class="fn_unit martmin">(kcal)</view>
								<view class="fn_unit padding-top-xxs">卡路里</view>
							</view>
						</view>
						<view v-for="(item,index) in dragList.fixexData" :key="index" class="text-center exitem d_ib">
							<view class="oth_box d_ib text-cuts" :style="{backgroundImage:`url(${item.backImgs})`}">
								<view class="list_value">{{item.value}}g</view>
								<view class="list_name text-cuts">{{item.name}}</view>
							</view>
						</view>
					</view>

					<view class="flex align-center">
						<view class="change_box flex-sub text-cuts" v-for="(item,index) in dragList.changeData"
							:key="index">
							<view class="ch_val text-cuts">{{item.value}}</view>
							<view class="ch_name text-cuts">{{item.name}}</view>
						</view>
					</view>
				</view>
			</view>
		</dragButtons> -->
		<loading></loading>
	</view>
</template>
<script lang="ts" setup>
	import { ref, reactive, computed, nextTick } from "vue";
	import { onLoad, onShow, onUnload } from "@dcloudio/uni-app";
	import { showLoading, hideLoading, plusXing, mnavTo, getNowDate } from '@/utils/helper';
	import mApi from "@/utils/mapi";
	// import speciModal from '@/components/speciModal/speciModal.vue'
	import speciModal from './spcModel.vue'
	import setAutoMeal from '@/components/setAutoMeal/setAutoMeal.vue';
	import setMealsModal from '@/components/setMealsModal/setMealsModal.vue';
	import tabs from '@/components/comtabs/comtabs.vue';
	import { env } from '@/api/env.js';
	import slideContent from '@/uni_modules/you-touchbox/components/you-touchbox/you-touchbox.vue';
	// import dragButtons from "@/components/dragButton/drag-button.vue"
	import { getCalDetail, getMealsTotalNl, doMealsSet, getMealsSet, getMealDate, getMealsSec, cancelMeals, getMealsGoodDetail, submitBuyingMealsNow, editCart, addMealCart, clearCart } from "@/api/vmeitime-http/index.js";
	import { useCartStore } from '@/stores/cartStore';
	import { useShopStore } from '@/stores/shopStore';
	import { useUserStore } from '@/stores/commonStore';
	const cartStore = useCartStore();
	const shopStore = useShopStore();
	const changeDrag = ref(false)
	const showNav = ref(false)
	const pop1 = ref(null);
	const pop2 = ref(null);
	const pop3 = ref(null);
	const pop4 = ref(null);//设置约餐
	const editProp = ref(null)   //修改约餐提示
	const deliveryTime = ref(null) //配送时段
	const mealMate = ref(null) //设置自动约餐
	const loaded = ref(false);
	const showCad = ref(false);//是否展开日历
	const showCalSub = ref(false);//是否展开日历详情
	const calMealDetail = ref<any>([])//已完成点餐详情-弹窗
	const calDetailTmoney = ref<any>(0)//已完成点餐详情-总金额
	const hasRecord = ref(true);//是否展示记录模块
	const suBtnKcal = ref("999");
	const iconUrl = ref(env.FileUrl + "food/ico/images/");
	const indexFlag = ref(0);
	const indexList = ref(0);
	const copywriting = ref('');
	const cancelData = ref([
		// {
		// 	state: false,
		// 	text: '取消全天'
		// },
		// {
		// 	state: false,
		// 	text: '取消中餐'
		// },
		// {
		// 	state: false,
		// 	text: '取消晚餐'
		// }
	])
	// const mealTitle = ref([
	// 	{
	// 		text: '看图点菜'
	// 	},
	// 	{
	// 		text: '菜名点菜'
	// 	}
	// ])
	const weekend = ref([
		// {
		// 	name: '今日',
		// 	day:'',
		// 	sxp_date:'',
		// 	status: 0,
		// 	acthum:0,
		// 	isToday:true,
		// },
		// {
		// 	name: '二',
		// 	// text: '二',
		// 	// statue: 1,  //吃过了 0  1 预约了  2待预约 
		// 	day:'',
		// 	sxp_date:'',
		// 	status: 1,
		// 	acthum:1,
		// 	isToday:true,
		// },
		// {
		// 	name: '三',
		// 	day:'',
		// 	sxp_date:'',
		// 	status: 2,
		// 	acthum:0,
		// 	isToday:true,
		// },
		// {
		// 	name: '四',
		// 	day:'',
		// 	sxp_date:'',
		// 	status: 1,
		// 	acthum:0,
		// 	isToday:true,
		// },
		// {
		// 	name: '五',
		// 	day:'',
		// 	sxp_date:'',
		// 	status: 1,
		// 	acthum:0,
		// 	isToday:true,
		// },
		// {
		// 	name: '六',
		// 	day:'',
		// 	sxp_date:'',
		// 	status: 2,
		// 	acthum:0,
		// 	isToday:true,
		// },
		// {
		// 	name: '日',
		// 	day:'',
		// 	sxp_date:'',
		// 	status: 1,
		// 	acthum:0,
		// 	isToday:true,
		// }
	])
	// const dragList = ref(
	// 	{
	// 		fixexData: [{
	// 			value: "99",
	// 			name: "膳食纤维",
	// 			backImgs: iconUrl.value + "car_bg04.png"
	// 		}, {
	// 			value: "99",
	// 			name: "碳水",
	// 			backImgs: iconUrl.value + "car_bg05.png"
	// 		}, {
	// 			value: "99",
	// 			name: "脂肪",
	// 			backImgs: iconUrl.value + "car_bg06.png"
	// 		}],
	// 		changeData: [
	// 			{
	// 				value: "9",
	// 				name: "食物种类",
	// 			}, {
	// 				value: "5",
	// 				name: "维C",
	// 			}, {
	// 				value: "6",
	// 				name: "钙",
	// 			}, {
	// 				value: "18",
	// 				name: "铁",
	// 			}, {
	// 				value: "152",
	// 				name: "维A",
	// 			}
	// 		]
	// 	}
	// )
	const mealsClass = ref('') //设置自动约餐切换
	const allowSubmits = ref(true)
	const tabClass = ref(null)//中餐晚餐
	const lunchName = ref('')  //配送时段  午
	const dinnerName = ref('') //配送时段  晚
	const breakfastName = ref('') //配送时段  时间

	const timeFlag = ref(false)
	const mealsList = ref([
		{
			name: '天天送',//1178天天送，1179工作日送,1180周末送，1181我不需要,1182自定义
			text: '每天配送',
			dis: '',
			id: '1178'
		},
		{
			name: '工作日送',
			text: '周一到周五配送',
			dis: '',
			id: '1179'
		},
		{
			name: '周末送',
			text: '周六日配送',
			dis: '',
			id: '1180'
		},
		{
			name: '手动约餐',
			text: '系统不自动约餐',
			dis: '',
			id: '1181'
		},
		{
			name: '自定义',
			text: '我时间较灵活',
			dis: '',
			id: '1182'
		}
	])
	//配送时间段

	const mealData = ref([
		// {
		// 	id: '1186',
		// 	name: '早餐',
		// 	state: false,
		// 	setedTime: '',
		// 	type: 'breakfast',
		// 	time: [
		// 		{
		// 			text: '6:30-7:00',
		// 			flag: false
		// 		},
		// 		{
		// 			text: '7:00-7:30',
		// 			flag: false
		// 		},
		// 		{
		// 			text: '7:30-8:30',
		// 			flag: false
		// 		}
		// 	]
		// },
		// {
		// 	id: '1187',
		// 	name: '午餐',
		// 	state: false,
		// 	setedTime: '',
		// 	type: 'lunch',
		// 	time: [
		// 		{
		// 			text: '11:30-12:30',
		// 			flag: true
		// 		},
		// 		{
		// 			text: '12:30-13:30',
		// 			flag: false
		// 		},
		// 		{
		// 			text: '13:00-14:00',
		// 			flag: false
		// 		}
		// 	]
		// },
		// {
		// 	id: '1188',
		// 	name: '晚餐',
		// 	state: false,
		// 	setedTime: '',
		// 	type: 'dinner',
		// 	time: [
		// 		{
		// 			text: '17:30-18:00',
		// 			flag: false
		// 		},
		// 		{
		// 			text: '18:00-19:00',
		// 			flag: false
		// 		},
		// 		{
		// 			text: '18:30-19:30',
		// 			flag: false
		// 		}
		// 	]
		// }
	])
	const slcTimeGroup = ref<any>({});//当前选中时段
	const slcDeliveryMode = ref<any>('');//当前选中时段
	const userStore = useUserStore();
	const curGoodsId = ref('');//goodsid
	const mealDetail = ref<any>({});
	const sxpGroupList = ref<any>([]);//商品组列表
	const curSingleMealType = ref<any>('');//当前单套餐类型1176任选，1175固定
	const navlist = ref<any>([
		// {
		//   name: "早餐",
		//   id: '1186'
		// }, {
		//   name: "中餐",
		//   id: '1187'
		// },
		// {
		//   name: "晚餐",
		//   id: '1188'
		// }
	])
	const setDetails = ref<any>({});//设置详情
	const setedAddress = ref<any>({});//设置地址
	const selfParams = ref<any>([]);//自定义参数
	const fbillId = ref<any>('');//父订单ID
	const mtotalParams = ref<any>({});//当前多套能量、用餐数统计数据
	const calAnimationFn = ref(null);
	onLoad((options) => {
		// window.addEventListener('resize', this.handleOrientationChange);
		// fbillId goodsId sellerMemberId
		calAnimationFn.value = uni.createAnimation({
		  delay: 300
		  // timingFunction: 'ease',
		})
		showPop('editProp');
		fbillId.value = options.fbillId || '';
		curGoodsId.value = options.goodsId || 'SP20241009150785';//暂 SP20241016150862
		// curDate.value = getNowDate('-').intDay;
		console.log('getNowDate', getNowDate('-'))
		initCalenList();
		loadData('init');
		
		// initCalenList();
		// initCarData()
		// const sys = uni.getSystemInfoSync();
		// this.windowWidth = sys.windowWidth;
		// this.windowHeight = sys.windowHeight;
	});
	onShow(() => {
		nextTick(() => {
			console.log('show', cartStore.tcsCarList)
			console.log('show1111', cartStore.tcsMoreDetail)
			// upAdress//更新选择地址 tcsMoreDetail.skuGroup
			pop4.value.upAdress();
			if (cartStore.tcsCarList && cartStore.tcsCarList.length > 0 || (cartStore.tcsMoreDetail && cartStore.tcsMoreDetail.skuGroup && Object.keys(cartStore.tcsMoreDetail.skuGroup).length > 0)) {
				upAllData();
				return
			}
			// if(uni.getStorageSync('mealsAdresTips')){
			// 	// setedAddress.value = userStore.curSelecAdress;
			// 	uni.setStorageSync('mealsAdresTips',false);
			// }
			loaded.value && loadData('init');
			// let ob = { sxp_date: '2024-10-24', status: '', day: '1' }
			// cartStore.tcsCarList
		})

	})
	onUnload(() => {
		cartStore.setTmoreDetail();
		cartStore.setTsCarList();
	})
	const closeall = () => {
		mealData.value.forEach((item : any) => {
			item.state = false
		})
	}
	//选泽约餐中 或晚
	const selecyucan = (item : any, index : any) => {
		tabClass.value = index;
		mealData.value.forEach((i : any) => {
			i.state = i === item ? !i.state : false; // 仅切换当前项的状态，其它项关闭
		})
	}
	//选泽具体约餐时间区段
	const selecTips = (list : any, data : any, fatherItem : any) => {
		// fatherItem.setTime = list.text
		if (list.flag) {
			list.flag = false
			fatherItem.setedTime = "";
		} else {
			data.forEach((item : any) => {
				item.flag = false
			})
			list.flag = true
			fatherItem.setedTime = list.text; // 赋值为当前选中项的文本
		}
		setTimeout(() => {
			mealData.value.forEach((i : any) => {
				i.state = false;
			});
		}, 60);
	}
	// //确定约餐时间 回调约餐时间
	// const determine = () => {
	// 	let curDis = '',cgroup:any={},slcGroup:any=slcTimeGroup.value;
	// 	mealData.value.forEach(item => {
	// 		item.setedTime?curDis = curDis + (curDis? '/'+ item.name:item.name):'';
	// 		item.time.forEach(citem=>{
	// 			if(citem.flag){
	// 				!cgroup[item.id]?cgroup[item.id] = citem.text:''
	// 			}
	// 		})		
	// 	});
	// 	console.log('slcGroup+',slcGroup)
	// 	console.log('slcGroup+1',mealData.value)
	// 	slcDeliveryMode.value = mealsClass.value;
	// 	let mindex = mealsList.value.findIndex(mitem=>mitem.id==mealsClass.value)
	// 	mindex>=0?mealsList.value[mindex].dis = curDis:'';
	// 	slcGroup[mealsClass.value] = cgroup;
	// 	slcTimeGroup.value = slcGroup;//暂存数据
	// 	console.log('determine',mealsList.value);
	// 	hidePop('deliveryTime')
	// }
	// // 约餐方式-点击
	// const tapItemSelecMeal = (item : any, index : any) => {
	// 	mealsClass.value = item.id;
	// 	// slcDeliveryMode
	// 	if (item.id == '1182') {
	// 		showPop('pop1') //设置自定义约餐
	// 		// updateMealText(item.id)
	// 	} else if (item.id == '1181') {
	// 		//不需自动约餐
	// 		// updateMealText(item.id)
	// 	} else {
	// 		let group:any ={};
	// 		group = slcTimeGroup.value[mealsClass.value]||{};
	// 		console.log('tapItemSelecMeal',slcTimeGroup.value)
	// 		mealData.value.forEach(fitem=>{
	// 			// 同步暂存数据
	// 			// console.log('slcDeliveryMode',slcDeliveryMode.value&&slcDeliveryMode.value==mealsClass.value,slcTimeGroup.value[fitem.id])
	// 			// fitem.setedTime = slcDeliveryMode.value&&slcDeliveryMode.value==mealsClass.value&&slcTimeGroup.value[fitem.id]?slcTimeGroup.value[fitem.id]:'';
	// 			fitem.setedTime = group&&group[fitem.id]?group[fitem.id]:'';
	// 			fitem.time.forEach(citem=>{
	// 				citem.flag = group&&group[fitem.id]&&group[fitem.id]==citem.text?true:false;
	// 			})
	// 		})
	// 		tabClass.value = null;
	// 		showPop('deliveryTime')
	// 	}
	// }
	// // 设置约餐提交
	// const confirmSet = async () => {
	// 	let ndata : any = {
	// 		goodsId: curGoodsId.value || '',
	// 		goodsName: mealDetail.value.name || '',
	// 		startDate: '',
	// 		meal_cycle_type:'1192',//约餐时间模式(1191：日，1192：周)
	// 		deliveryMode: mealsClass.value || '',//配送模式（天天送、工作日送、节假日送、自定义，我不需要）
	// 		fatherBillId: fbillId.value||'',//10202410315124791156404
	// 		consignee: setedAddress.value.vname || '',//userStore.curSelecAdress
	// 		phone: setedAddress.value.vphone || '',
	// 		address_id: setedAddress.value.naddress_id || '',
	// 		address_detail: setedAddress.value.adrs || '',
	// 		// diyTime:'',//自定义时间（如果是自定义则必传）
	// 		// timeRangeType:'',//非自定义时间（如果不是自定义则必传）

	// 	};
	// 	if(!ndata.address_id){
	// 		mApi.msg('请选择配送地址')
	// 		return
	// 	}
	// 	if(mealsClass.value != '1182'&&mealsClass.value != '1181'){
	// 		let rty = [],rtm = [];
	// 		mealData.value.forEach(item=>{
	// 			if(item.setedTime){
	// 				rty.push(item.id);
	// 				rtm.push(item.setedTime);
	// 			}
	// 		})
	// 		ndata.rangeType = rty.join(',');
	// 		ndata.rangeTime =  rtm.join(',');
	// 	}
	// 	// mealsClass.value != '1182' ? ndata.rangeType = '1188,1187' : '';
	// 	// mealsClass.value != '1182' ? ndata.rangeTime = '11:30-12:30,11:30-12:30' : '';

	// 	if (mealsClass.value == '1182') {
	// 		// let diyTime : any = [];
	// 		// for (let i = 0; i < 1; i++) {
	// 		// 	diyTime.push({
	// 		// 		preTime: '20241031',
	// 		// 		rangeType: '1188',
	// 		// 		rangeTime:'11:30-12:30'
	// 		// 	})
	// 		// }
	// 		ndata.diyTime = selfParams.value;
	// 	}
	// 	try {
	// 		showLoading();
	// 		let res = await doMealsSet(ndata);
	// 		hideLoading();
	// 		hidePop('mealMate')
	// 	} catch (e) {
	// 		hideLoading();
	// 		console.error(e)
	// 	}

	// }

	// 多套餐设置-点击弹出弹窗-初始化数据
	const tapShowSet = async () => {
		showPop('pop4');
		// try {
		// 	if (!curGoodsId.value) {
		// 		mApi.msg('请稍后再试');
		// 		return
		// 	}
		// 	showLoading();
		// 	let res = await getMealsSet({ goodsId: curGoodsId.value || '',fatherBillId:fbillId.value })
		// 	if (!res.result || !res.object) {
		// 		hideLoading();
		// 		mApi.msg(res.shortMessage || '网络繁忙，请稍后.')

		// 	}
		// 	let nres = res.object||{}
		// 	setDetails.value = nres;
		// 	let tAddress = nres.tradeAddress||{},slcGroup:any={};// '1178':{1187:'11:30-12:30'}
		// 	tAddress.adrs = (tAddress.vprovince || '') + (tAddress.vcity || '') + (tAddress.vcounty || '') + (tAddress.vaddre_detail || '');
		// 	tAddress.source = 'manyMeals';
		// 	setedAddress.value = tAddress;	
		// 	slcDeliveryMode.value = nres.deliveryMode||'';
		// 	slcGroup[nres.deliveryMode]={};
		// 	mealsClass.value = nres.deliveryMode||'';//天天送、工作日送等
		// 	console.log('mealsClass-01',mealsClass.value)
		// 	if(nres.rangeType){
		// 		let rtyarr = nres.rangeType.split(',');
		// 		let rtmarr = nres.rangeTime.split(',');
		// 		for (let i = 0; i < rtyarr.length; i++) {
		// 			let item = rtyarr[i];
		// 			!slcGroup[nres.deliveryMode][item]?slcGroup[nres.deliveryMode][item]=rtmarr[i]:'';
		// 			// !slcGroup[item]?slcGroup[item]=[{id:item,rangeTime:rtmarr[i]}]:slcGroup[item].push({id:item,rangeTime:rtmarr[i]})
		// 		}
		// 		let ngoup = slcGroup[nres.deliveryMode]||{},curDis='';
		// 		// 初始化早中晚配置时间
		// 		mealData.value.forEach(item=>{
		// 			if(ngoup[item.id]){
		// 				let cindex = item.time.findIndex(citem=>citem.text==ngoup[item.id])
		// 				cindex>=0?item.time[cindex].flag = true:'';
		// 				cindex>=0?item.setedTime = ngoup[item.id]:'';
		// 			}
		// 			item.setedTime?curDis = curDis + (curDis? '/'+ item.name:item.name):'';
		// 		})
		// 		mealsList.value.forEach(mitem=>{
		// 			mitem.id&&mealsClass.value==mitem.id?mitem.dis = curDis:'';
		// 			// mitem.dis = mitem.id&&mealsClass.value==mitem.id?curDis:'';
		// 		})
		// 		// let mindex = mealsList.value.findIndex(mitem=>mitem.id==mealsClass.value)

		// 		slcTimeGroup.value = slcGroup;

		// 		console.log('slcGroup01',slcGroup,curDis);
		// 		console.log('slcGroup',mealData.value);


		// 	}
		// 	hideLoading();
		// 	showPop('mealMate');

		// } catch (e) {
		// 	console.error(e)
		// }

	}
	//配送时段遮罩层触发
	// const maskClick = (e) => {
	// 	// updateMealText(mealsClass.value)
	// }
	//配送时段文案重置
	// const updateMealText = (targetId : any) => {
	// 	mealsList.value.forEach(item => {
	// 		if (item.id === targetId) {
	// 			item.text = "";
	// 		} else {
	// 			// 恢复其他项的原有值 1178天天送，1179工作日送,1180周末送，1181我不需要,1182自定义
	// 			switch (item.id) {
	// 				case '1178':
	// 					item.text = '每天配送';
	// 					break;
	// 				case '1179':
	// 					item.text = '周一到周五配送';
	// 					break;
	// 				case '1180':
	// 					item.text = '周六日配送';
	// 					break;
	// 				case '1181':
	// 					item.text = '系统不自动约餐';
	// 					break;
	// 				case '1182':
	// 					item.text = '我时间较灵活';
	// 					break;
	// 				default:
	// 					item.text = ''; // 其他情况可根据需求处理
	// 			}
	// 		}
	// 	});
	// };
	// const transdTime = (v)=>{
	// 	let r = '';
	// 	if(v){
	// 		r = v.substring(0, 4) + '-' + v.substring(4, 6) + '-' + v.substring(6, 8);
	// 	}
	// 	return r

	// }
	//更新购物车及列表数据
	const upAllData = (source : any = '') => {
		let marr = JSON.parse(JSON.stringify(cartStore.tcsCarList));
		let nlist = curAddLists.value.filter(item => item.isTaoCan);
		let index = marr.findIndex(item => item.replaceSku);
		console.log('newCar00nlist', nlist[0])
		console.log('newCar00marr', marr)


		// 来自替换组商品-底部购物车换一个
		if (index >= 0) {
			let cindex = index >= 0 ? nlist.findIndex(item => item.sku == marr[index].replaceSku) : -1;
			if (cindex >= 0) {
				let nitm = Object.assign({}, nlist[cindex], marr[index]);
				marr.splice(index, 1, nitm);
				marr[index].nums >= nlist[cindex].nums ? nlist.splice(cindex, 1) : nlist[cindex].nums = nlist[cindex].nums - marr[index].nums;

			}

		}
		curAddLists.value = nlist.concat(marr);
		upGoodGoups();
		console.log('newCar', curAddLists.value)
		changeListNums('init')
		cartStore.setTsCarList();
		console.log('newCar33', cartStore.tcsCarList)
	}

	const getGroups = () => {
		let r : any = { skus: {} };//cartStore.tcsCarList 
		if (curAddLists.value.length > 0) {
			let spcMergedData = {};//sku分组
			curAddLists.value.forEach((item : any) => {
				if (spcMergedData[item.sku]) {
					spcMergedData[item.sku].num += item.nums;
				} else {
					spcMergedData[item.sku] = { num: item.nums, sku: item.sku };
				}
			});
			r.skus = spcMergedData;
			// r.skus = Object.values(spcMergedData);
		}
		return r.skus;//只需sku
	}
	const allowModifyTime = ref<any>('0');//当前选中允许下单时间
	// 是否能约餐canSubmit
	const submiType = computed(() => {
		// let r = {
		// 	canApiont:false,//能否约餐
		// 	canCancel:false//能否取			
		// };
		// let r = false;
		let r : any = {}, status = curSelect.value.status || null;

		if (allowModifyTime.value && navlist.value.length > 0) {
			const id = navlist.value[navClass.value].id;//早中晚
			// let tpnums = 0;//可预约数
			if (id == '1186') {
				//早餐可预约数//早餐已预约数
				r = transStatus(curSelect.value.can_pre_morning_nums, curSelect.value.is_pre_morning_nums, status);

			} else if (id == '1187') {
				r = transStatus(curSelect.value.can_pre_noon_nums, curSelect.value.is_pre_noon_nums, status);

			} else {
				r = transStatus(curSelect.value.can_pre_night_nums, curSelect.value.is_pre_night_nums, status);
			}
			// 
			// r = allowModifyTime.value > getNowDate().nmin
		}
		console.log('submiType', r)
		return r

	})
	// 按钮状态
	const transStatus = (knums : any, ynums : any, status : any) => {
		// 可约数,已约数，状态986 可约 987 已约 988 完成了knums>=ynums&&
		let s = '', r : any = {}, rtime = allowModifyTime.value > getNowDate().nmin, name = '';
		console.log('transStatus', rtime, allowModifyTime.value, getNowDate().nmin);

		// s = (status == '986' || status == '987') && knums > 0 && rtime ? 'ky' : status == '987' && ynums > 0 && rtime ? 'qx' : status == '988' ? 'ov' : '';
		s = (status == '986' || status == '987') && rtime ? 'ky' : status == '988' ? 'ov' : '';
		name = s == 'ky' ? '约餐' : s == 'qx' ? '取消' : s == 'ov' ? '已用餐' : '';
		if (!name) {
			name = knums > 0 && !rtime ? '已过约餐时间' : '';//ynums > 0 && !rtime ? '已约' :
		}
		r = {
			name: name,
			knums: knums,
			ynums: ynums,
			status: s
		}
		return r
	}

	// 重置数据
	const rezDetailData = () => {
		navlist.value = [];
		sxpGroupList.value = [];
		curAddLists.value = [];
		ruleGoup.value = {};
		allowModifyTime.value = '';
	}
	// 加载数据
	const loadData = async (source : any = '') => {
		console.log('dateeee', getNowDate())
		try {

			let rDate = curDefDate.value ? curDefDate.value.split('-').join('') : '';
			console.log('nowDate++111', curDate.value, source)
			source != 'tap-md' && showLoading();
			if (source == 'init' || source == 'swiper' || !hasFillCalen.value) {
				getMealsNl();//查询总热量等
				getTimeSec();// 获取餐段
				// 获取日历
				let cres = await getMealDate({ fatherBillId: fbillId.value, goodsId: curGoodsId.value, sxpTime: rDate })
				loaded.value = true;
				if (cres.result && cres.object) {
					fillCalenList(cres.result && cres.object ? cres.object || [] : '', source);
				} else {
					fillWeekList(swiperList.value[curSwiperIndex.value], 'def')
					rezDetailData();
					hideLoading();
					mApi.msg(cres.shortMessage || '网络繁忙，稍后再试', cres.code)
					return
				}
			}

			let nowDate = curDate.value ? curDate.value.split('-').join('') : '';
			console.log('nowDate++', nowDate, curDate.value, source)
			if (!nowDate) {
				loaded.value = true;
				rezDetailData();
				hideLoading();
				// mApi.msg("请选择日期哦")
				return
			}
			// 获取套餐商品列表
			// ,range_type:navlist.value[navClass.value].id
			let res = await getMealsGoodDetail({ goodsId: curGoodsId.value, realDays: curSelect.value.realDays, nowDate: nowDate, fatherBillId: fbillId.value })
			loaded.value = true;
			hideLoading();
			if (!res.result) {
				rezDetailData();
				return
			}
			let nres = res.object || {};
			mealDetail.value = nres;
			curSingleMealType.value = nres.sxp_mode || '';//模式
			source == 'init' && uni.setNavigationBarTitle({
				title: nres.name || '套餐'
			});
			// 按早中晚分组
			let timeGroup = {}, nlist = nres.sxpGroupList || [], nav = [];
			nlist.forEach(item => {
				if (!timeGroup[item.range_type]) {
					timeGroup[item.range_type] = [];
					timeGroup[item.range_type].push(item)
				} else {
					timeGroup[item.range_type].push(item)
				}

			})

			for (let key in timeGroup) {
				let citem = timeGroup[key];
				// list,group,carList
				let r = initGoods(citem);
				nav.push({
					name: trNavName(key),
					id: key,
					list: r.list,
					ruleGoup: r.group,
					carList: r.carList
				})
			}
			navlist.value = nav;//早中晚
			// 初始化数据
			if (nav.length > 0) {
				sxpGroupList.value = nav[navClass.value].list;//默认选第一个
				curAddLists.value = nav[navClass.value].carList;
				ruleGoup.value = nav[navClass.value].ruleGoup;
				let altime = sxpGroupList.value[0].allow_modify_time || '';
				allowModifyTime.value = curDate.value && sxpGroupList.value && sxpGroupList.value[0].allow_modify_time ? curDate.value.split('-').join('') + (altime ? altime.split(':').join('') : '') : '';
				// if (cartStore.tcsCarList && cartStore.tcsCarList.length > 0) {
				// 	upAllData()
				// }
			} else {
				rezDetailData();
			}
			console.log('timeGroup', timeGroup, nav)
			console.log('curDate.value-allowModifyTime', curDate.value, allowModifyTime.value)
			// sxpGroupList.value = initGoods(nlist); 原
			console.log('初始化购物车addlist', curAddLists.value);
			console.log('初始化购物车ruleGoup', ruleGoup.value);
			console.log('mealDetail', mealDetail.value)
			console.log('sxpGroupList', sxpGroupList.value)
		} catch (e) {
			loaded.value = true;
			rezDetailData();
			console.error(e)
			showLoading();
		}
	}

	// 获取能量总和
	const getMealsNl = async () => {
		try {
			let res = await getMealsTotalNl({ goodsId: curGoodsId.value, fatherBillId: fbillId.value })
			if (res.result && res.object) {
				mtotalParams.value = res.object || {};
			} else {
				mApi.msg(res.shortMessage || '网络繁忙，稍后再试', res.code)
			}
		} catch (e) {
			console.error(e)
		}
	}
	const getTimeSec = async () => {
		try {
			let res = await getMealsSec({ goodsId: curGoodsId.value })
			if (res.result && res.object) {
				mealData.value = initCanDuan(res.object || []);
				console.log('getTimeSec', mealData.value)
			} else {
				mApi.msg(res.shortMessage || '网络繁忙，稍后再试', res.code)
			}
		} catch (e) {
			console.error(e)
		}

	}
	const initCanDuan = (list : any = []) => {
		if (list.length > 0) {
			list.forEach(item => {
				let index = item.time ? item.time.findIndex(citem => citem.flag) : -1;
				console.log('initCanDuan00', index)
				item.state = false;
				item.id = item.rangeType;
				item.setedTime = index >= 0 ? item.time[index].text : '';
				item.name = item.id == '1186' ? '早餐' : item.id == '1187' ? '午餐' : item.id == '1188' ? '晚餐' : '';
			})
		}
		console.log('initCanDuan', list)
		return list
	}
	const trNavName = (id : any) => {
		let r = id == '1186' ? '早餐' : id == '1187' ? '中餐' : id == '1188' ? '晚餐' : '';
		return r
	}

	const ruleGoup = ref<any>({});//保存每组的数据
	// 初始化数据
	const initGoods = (list : any = []) => {
		let group = {}, carList = [];
		list.forEach((item : any, index : any) => {
			let clist = item.specList || [], basePrice = null;
			// 任选一basePrice 价格展示逻辑
			if (item.min_nums >= 1 && item.max_nums <= 1) {
				let defindex = clist.findIndex(ditem => ditem.is_default_buy == '5')
				defindex >= 0 ? basePrice = (shopStore.costPlan == '1130' ? clist[defindex].sxp_site_sell_price ?? 0 : clist[defindex].sxp_out_sell_price ?? 0) : '';
			}
			for (let i = 0; i < clist.length; i++) {
				let citem = clist[i];
				// is_default_buy是否默认选中/数量展示
				// is_more_buy是否允许多买
				// is_must_buy是否必买
				citem.findex = index;
				citem.fminNums = item.min_nums;//组最小购买数量
				citem.fmaxNums = item.max_nums;
				citem.fname = item.vname || '';//组名
				citem.fShowMore = item.is_add_goods == '5';//组是否展示更多按钮
				citem.fReplace = item.is_update_goods == '5';//组是否可更换商品
				citem.num = citem.is_default_buy == '5' || citem.is_must_buy == '5' ? (citem.nsell_nums > 0 && citem.sku_status == '233' && citem.nsell_nums >= citem.min_nums ? citem.min_nums : 0) : 0;//当前默认数量
				citem.isLock = citem.is_must_buy == '5' && citem.is_more_buy == '6';//锁
				citem.sminNums = citem.min_nums || 0;
				citem.smaxNums = citem.nsell_nums > 0 && citem.sku_status == '233' && citem.nsell_nums >= citem.min_nums ? citem.is_more_buy == '6' ? (citem.min_nums || 0) : (citem.nsell_nums >= citem.max_nums ? citem.max_nums || 0 : citem.nsell_nums) : 0;//
				citem.isMust = citem.is_must_buy == '5';
				citem.isBuyMore = citem.is_more_buy == '5';
				citem.isTaoCan = true;//套餐组内商品
				citem.showPrice = null;//展示价格
				let nprice = (shopStore.costPlan == '1130' ? citem.sxp_site_sell_price ?? 0 : citem.sxp_out_sell_price ?? 0);
				if (basePrice != null && citem.is_default_buy != '5') {
					citem.isPosPrice = nprice >= basePrice;
					citem.showPrice = transQsPrice(Math.abs(nprice - basePrice));//citem.is_default_buy=='5'?nprice:(nprice - basePrice)
				}
				let param = {
					fname: citem.fname,//组名
					fminNums: citem.fminNums || 0,//组最小购买数量
					fmaxNums: citem.fmaxNums || 0,
					fReplace: citem.fReplace,//组是否可更换商品
					sminNums: citem.sminNums,//商品最起购数量
					smaxNums: citem.smaxNums,
					isLock: citem.isLock,//锁
					isMust: citem.isMust,//是否必须购买
					isBuyMore: citem.isBuyMore,//是否允许多买
					isTaoCan: true,//套餐组内商品
					name: citem.goodsname || '',//商品名
					img: citem.vimage || citem.vmaster_product_image_id || '',
					nums: citem.num,
					goods_id: citem.goods_id,
					sku: citem.sku,
					labelIds: citem.labelIds || [],
					nprice: nprice,
					storeNum: citem.nsell_nums || 0,
					status: citem.sku_status

				}
				!group[citem.goods_id] ? group[citem.goods_id] = { tnums: (citem.num || 0), ...param } : group[citem.goods_id].tnums += citem.num;
				// console.log('cccc++',citem.num,group)
				if ((citem.is_default_buy == '5' || citem.is_must_buy == '5') && citem.num > 0) {
					carList.push(param)
					// curAddLists.value.push(param)
				}

			}
			// ruleGoup.value = group;//当前购物车数量按goods_id分组

		})
		console.log('初始化购物车addlist', curAddLists.value);
		console.log('初始化购物车ruleGoup', ruleGoup.value);

		return {
			list,
			group,
			carList
		}
	}

	const transQsPrice = (num : any) => {
		if (Number.isInteger(num)) {
			return num; // 如果是整数，直接返回
		} else {
			return num.toFixed(2); // 否则，保留两位小数
		}
	}
	// 获取商品当前可购买数
	const getSmaxNum = (item : any, source : any = '') => {

		let group = ruleGoup.value, tnum = 0, max = item.max_nums || 0;
		if (item.fmaxNums > 0) {
			// curAddLists.value.forEach(citem=>{
			// 	!group[citem.goods_id]?group[citem.goods_id] = {tnums:citem.nums,...citem}:group[citem.goods_id].tnums+=citem.nums;
			// })
			tnum = group[item.goods_id] ? group[item.goods_id].tnums : 0;
			max = tnum >= item.fmaxNums && item.num > 0 ? item.num : item.max_nums;//获取商品当前可购买数 组剩余能购买最大数 当前商品数量（任选一自动重置其他商品数量为0）
		}

		return max
	}
	// 是否重置购物车及商品-根据组最大数操作商品，规则-按顺序删除组商品列表靠前商品
	const needRzNum = (item : any, source : any = '') => {
		// console.log('needRzNumfn',ruleGoup.value)
		let group = ruleGoup.value, tnum = 0, needRz = false;
		tnum = group[item.goods_id] ? group[item.goods_id].tnums : 0;
		console.log('needRzNumfn', group[item.goods_id], group[item.goods_id].tnums, tnum)
		needRz = item.fmaxNums > 0 && tnum >= item.fmaxNums ? true : false;
		// console.log('needRzNumfn++',item.fmaxNums>0,tnum>=item.fmaxNums,tnum,group[item.goods_id],item.fmaxNums)
		return needRz
	}

	const calcData = computed(() => {
		let r : any = { totPayMoney: 0 }, totBaseMoney = 0, moreMoney = 0;
		//固定套餐
		if (curSingleMealType.value == '1175') {
			totBaseMoney = shopStore.costPlan == '1130' ? mealDetail.value.site_sell_price : mealDetail.value.out_sell_price;
			let arr = curAddLists.value.filter(item => !item.isTaoCan);//更多中添加的商品
			if (arr.length > 0) {
				arr.forEach(aitem => {
					moreMoney += (aitem.nprice || 0) * aitem.nums;
				})
			}
		} else {
			curAddLists.value.forEach(item => {
				totBaseMoney += (item.nprice || 0) * item.nums;
			})
		}
		r.totPayMoney = transQsPrice(totBaseMoney + moreMoney);
		return r
	})

	// const addParams = computed(() => {
	// 	let r : any = [];
	// 	sxpGroupList.value.forEach(item => {
	// 		let clist = item.specList || [];
	// 		for (let i = 0; i < clist.length; i++) {
	// 			let citem = clist[i];
	// 			citem.num > 0 && r.push({
	// 				name: citem.goodsname || '',
	// 				img: citem.vimage || citem.vmaster_product_image_id || '',
	// 				nums: citem.num,
	// 				sku: citem.sku,
	// 				goods_id: citem.goods_id,
	// 				labelIds: citem.labelIds || []
	// 			})
	// 			// let index = cachDefCarList.value.findIndex(fitem=>fitem.sku==citem.sku)
	// 			// if(index>=0){

	// 			// }else{

	// 			// }
	// 		}

	// 	})
	// 	console.log('addParams', r)
	// 	// cachDefCarList.value = r;
	// 	return r;
	// });

	// console.log('object',timeStr);
	const mealList = ref([
		{
			tabName: "固定推荐",
			tabList: [
				{
					id: '0',
					name: '蒜苗孜然牛肉',
					dis1: '小份(约100g)',
					dis2: '111Kcal',
					img: 'https://cdn-static.yekjx.com/food/images/meal_img06.png',
					select: false,
					num: 1,
					isLock: true,
					disabled: true,
					price: "28.00"
				},
				{
					id: '1',
					name: '手撕鸡',
					dis1: '小份(约100g)',
					dis2: '178Kcal',
					img: 'https://cdn-static.yekjx.com/food/images/sw_img01.png',
					select: true,
					num: 1,
					isLock: false,
					disabled: false,
					price: "28.00",
					type: 'dz'
				}, {
					id: '2',
					name: '番茄鸡蛋',
					dis1: '小份(约100g)',
					dis2: '178Kcal',
					img: 'https://test-cdn-static.yekjx.com/resouces/goods/1723444678726.jpg',
					select: false,
					num: 1,
					isLock: false,
					disabled: false,
					price: "28.00"
				}, {
					id: '3',
					name: '手撕鸡',
					dis1: '小份(约100g)',
					dis2: '178Kcal',
					img: 'https://test-cdn-static.yekjx.com/resouces/goods/1722567991273.png',
					select: false,
					num: 1,
					isLock: false,
					disabled: false,
					price: "28.00"
				}, {
					id: '4',
					name: '手撕鸡',
					dis1: '小份(约100g)',
					dis2: '178Kcal',
					img: 'https://test-cdn-static.yekjx.com/resouces/goods/1722493563264.jpg',
					select: false,
					num: 1,
					isLock: false,
					disabled: false,
					price: "28.00"
				}
			]
		}, {
			tabName: "水果",
			tabList: [
				{
					id: '0',
					name: '炎陵黄桃 中果',
					dis1: '1个',
					dis2: '111Kcal',
					img: 'https://test-cdn-static.yekjx.com/resouces/goods/1723859555303.png',
					select: false,
					num: 1,
					isLock: true,
					disabled: true,
					price: "28.00"
				},
				{
					id: '1',
					name: '洛川苹果 大果',
					dis1: '4个/盒 约720-750g/份',
					dis2: '178Kcal',
					img: 'https://test-cdn-static.yekjx.com/resouces/goods/1724029306007.png',
					select: true,
					num: 1,
					isLock: false,
					disabled: false,
					price: "28.00"
				}
			]
		}, {
			tabName: "汤",
			tabList: [
				{
					id: '0',
					name: '当归玉竹乌鸡汤',
					dis1: '260ml/份',
					dis2: '111Kcal',
					img: 'https://cdn-static.yekjx.com/food/images/meal_img05.png',
					select: false,
					num: 1,
					isLock: true,
					disabled: true,
					price: "28.00"
				},
				{
					id: '1',
					name: '胶原雪燕金耳羹',
					dis1: '300ml/份',
					dis2: '178Kcal',
					img: 'https://test-cdn-static.yekjx.com/resouces/goods/1722567876187.png',
					select: true,
					num: 1,
					isLock: false,
					disabled: false,
					price: "28.00"
				}
			]
		}
	])
	const calenList = ref<any>([]);
	let state = reactive({
		// swiperList: [{
		// 	id: 0,
		// 	type: 'image',
		// 	url: 'https://cdn-static.yekjx.com/food/images/sw_img01.png'
		// }, {
		// 	id: 1,
		// 	type: 'image',
		// 	url: 'https://cdn-static.yekjx.com/food/images/sw_img01.png',
		// }],
		mealList1: [
			{
				id: '0',
				name: '蒜苗孜然牛肉',
				dis1: '小份(约100g)',
				dis2: '111Kcal',
				img: 'food/images/meal_img06.png',
				select: false,
				num: 0,
				isLock: true,
				disabled: true,
				price: "28.00"
			},
			{
				id: '1',
				name: '手撕鸡',
				dis1: '小份(约100g)',
				dis2: '178Kcal',
				img: 'food/images/meal_img05.png',
				select: true,
				num: 1,
				isLock: false,
				disabled: false,
				price: "28.00"
			}, {
				id: '2',
				name: '手撕鸡',
				dis1: '小份(约100g)',
				dis2: '178Kcal',
				img: 'food/images/meal_img05.png',
				select: true,
				num: 1,
				isLock: false,
				disabled: false,
				price: "28.00"
			}, {
				id: '3',
				name: '手撕鸡',
				dis1: '小份(约100g)',
				dis2: '178Kcal',
				img: 'food/images/meal_img05.png',
				select: true,
				num: 1,
				isLock: false,
				disabled: false,
				price: "28.00"
			}, {
				id: '4',
				name: '手撕鸡',
				dis1: '小份(约100g)',
				dis2: '178Kcal',
				img: 'food/images/meal_img05.png',
				select: true,
				num: 1,
				isLock: false,
				disabled: false,
				price: "28.00"
			}
		],

		carList: [],
		dzfId: '',
		dztId: '',
		tapcalx: 0,
		tapcaly: 0
	});
	const tapcalx = ref(0);
	const tapcaly = ref(0);
	const imgBaseUrl = ref(env.imgBaseUrl);
	const curStatus = ref('');
	const curSelect = ref<any>({});
	//取消约餐选择
	const tabRadioSel = (list : any) => {
		cancelData.value.forEach((item) => {
			item.state = false
		});
		list.state = true
	}
	const navClass = ref(0);
	const tabSelect = (item : any, index : any) => {
		console.log('item', item, index, navlist.value)
		if (navClass.value == index) {
			return;
			// navlist[navClass.value].id
		}
		navClass.value = index;
		sxpGroupList.value = navlist.value[index].list;//默认选第一个
		curAddLists.value = navlist.value[index].carList;
		ruleGoup.value = navlist.value[index].ruleGoup;
		let altime = sxpGroupList.value[0].allow_modify_time || '';
		allowModifyTime.value = curDate.value && sxpGroupList.value && sxpGroupList.value[0].allow_modify_time ? curDate.value.split('-').join('') + (altime ? altime.split(':').join('') : '') : '';
		// loadData()

	}
	//点单模式切换
	const selecTab = (index : any) => {
		indexFlag.value = index
	}
	//文字版点单
	const selecList = (item : any, index : any, data : any) => {
		if ((item.isMust || item.isLock) && item.num > 0 || submiType.value.status != 'ky' || item.sku_status != '233' || item.nsell_nums <= 0) {
			return
		}
		if (item.num > 0) {
			item.oldNum = item.num;
			item.num = 0
		} else {
			if (getSmaxNum(item) <= 0) {
				return
			}
			// if (item.fmaxNums == 1) {
			// 	let list = sxpGroupList.value[item.findex].specList || [];
			// 	list.forEach(litem => {
			// 		item.sku && item.sku != litem.sku ? litem.num = 0 : '';
			// 	})
			// }
			item.num = item.oldNum ? item.oldNum : item.sminNums || 1;
		}
		let param = {
			findex: item.findex,
			fname: item.fname,//组名
			fminNums: item.fminNums || 0,//组最小购买数量
			fmaxNums: item.fmaxNums || 0,
			fReplace: item.fReplace,//组是否可更换商品
			sminNums: item.sminNums,
			smaxNums: item.smaxNums,
			isLock: item.isLock,//锁
			isMust: item.isMust,//是否必须购买
			isBuyMore: item.isBuyMore,//是否允许多买
			isTaoCan: true,//是否套餐商品
			name: item.goodsname || '',
			img: item.vimage || item.vmaster_product_image_id || '',
			nums: item.num,
			goods_id: item.goods_id,
			sku: item.sku,
			labelIds: item.labelIds || [],
			nprice: (shopStore.costPlan == '1130' ? item.sxp_site_sell_price ?? 0 : item.sxp_out_sell_price ?? 0),
			storeNum: item.nsell_nums || 0,
			status: item.sku_status

		}
		changeCar(item.sku, item.num, param);
		// console.log(item.select, index)
	}
	const dragDirect = ref('right')
	const curList = ref([])
	const getClass = () => {
		if (showNav.value == false) {
			if (dragDirect.value == 'left') {
				return 'transform: rotateY(360deg);'
			} else {
				return 'transform: rotateY(180deg);'
			}
		}
		if (showNav.value == true) {
			if (dragDirect.value == 'left') {
				return 'transform: rotateY(180deg);'
			} else {
				return 'transform: rotateY(360deg);'
			}
		}
	}
	const dragTouchend = (params : any) => {
		dragDirect.value = params.direction;
	}
	const tapToggleDrag = () => {
		showNav.value = !showNav.value
		changeDrag.value = true;
		setTimeout(() => {
			changeDrag.value = false;
		}, 10);
	}
	const computedStyle = computed(() => ({
		marginTop: '-30rpx',//hasRecord.value ? '0' : '-30rpx'
		// boxShadow: hasRecord.value ? '0px -4px 10px 0px rgba(1, 33, 18, 0)' : '0px -4px 10px 0px rgba(1, 33, 18, 0.4)',
		borderRadius: hasRecord.value ? '0 !important' : '20rpx 20rpx 0 0',//20rpx 取消间隔-1  
	}))
	// const carList = computed(() => {
	// 	return curList.value.filter(item => item.num > 0);
	// });
	const selecttData = computed(() => {
		let num = 0,
			totalMoney = 0,
			vipDisMoney = 0,
			slcs = [];
		// curList.value.forEach(item => {
		// 	item.selectNums > 0 ? (num += item.selectNums || 0) : "";
		// 	item.num > 0 ? (totalMoney += ((item.price || 0) * (item.num || 0))) : "";
		// 	item.selectNums > 0 && slcs.push(item)
		// });

		mealList.value.forEach(item => {
			item.tabList.forEach(j => {
				// j.num > 0 ? (totalMoney += ((parseFloat(j.price) || 0) * (j.num || 0))) : "";
				if (j.select) {
					totalMoney += ((parseFloat(j.price) || 0) * (j.num || 0))
					slcs.push(j)
				}
			});
		});

		let slc = {
			totalNum: num,
			sList: slcs,
			title: '已选VIP专区券使用明细',
			totalMoney: totalMoney,
			vipDisMoney: vipDisMoney
		};
		console.log('slc.sList---------------------', slc.sList)
		return slc;
	});
	const goodList = ref([])
	goodList.value = [...state.mealList1]
	const initCarData = () => {
		//初始化car,模拟
		curList.value = goodList.value;
		console.log(' curList.value----', curList.value)
		// loaded.value = true
		// carList.value 
		// let cindex  = curList.value.findIndex(item=>item.num>0);
		// carList.value 
		// console.log('car-init0',curList.value)
	}
	const calboxH = ref(0);
	//切换日历
	const tapToggleCal = () => {
		// if(!showCad.value){
		// 	const query = uni.createSelectorQuery();
		// 	query.select('.mcalCont').boundingClientRect();
		// 	query.exec((res) => {
		// 		if (res[0]) {
		// 			// res[0]即为所需的元素信息
		// 			console.log('boxH000', res)
		// 			console.log(`宽度000: ${res[0].width}px, 高度000: ${res[0].height}px`);
		// 			calboxH.value = res[0].height
		// 			showCad.value = !showCad.value;
		// 		}
		// 	});
		// 	return
		// }
		!showCad.value?calAnimationBegin():calAnimationEnd();
		showCad.value = !showCad.value;
		// calboxH.value = 0;

	}
	// const animationCal = ref<any>({});
	const calStyle = ref<any>({overflow:'hidden'});
	//底部提交
	const calAnimationBegin = () => {
		
		setTimeout(()=>{
			calStyle.value.overflow = 'initial'
		},200)
		
	  // console.log('carAnimationBegin+开始')
	  // calAnimationFn.value.width("750rpx").left(0).step()
	  // calAnimationFn.value.step()
	  // animationCal.value = calAnimationFn.value.export()
	}
	const calAnimationEnd = () => {
		calStyle.value.overflow = 'hidden'
		
	  // console.log('carAnimationEnd+结束')
	  // caranimation.value.width("635rpx").left("120rpx").step()
	  // animationCal.value = calAnimationFn.value.export()
	}
	const curMonth = ref<any>(null);//new Date().getMonth() + 1
	const curYear = ref<any>(null);
	const curDay = ref<any>(null);
	const cachPreDay = ref<any>(null);//暂++
	const filcalen = ref(false);
	const swcircular = ref(true);
	const curDate = ref('');//选中日期 2024-01-01
	const curDefDate = ref('');//记录默认选中日期 切换月份
	const swiperList = ref<any>([[], [], []]);
	const curSwiperIndex = ref(1);
	const hasFillCalen = ref(false);
	// 汉字表示的一周中的每一天
	const weekDays = ['日', '一', '二', '三', '四', '五', '六'];
	// 初始化日历数据
	const fillCalenList = (res : any = '', source : any = '') => {
		if (!res) {
			return;
		}
		let y : any = '', m : any = '', dayListItem = res || [];
		let fst = res[0] && res[0].sxp_date ? res[0].sxp_date.split('-') : '';
		if (fst) {
			y = fst[0] || '';
			m = fst[1] ? Number(fst[1]) : '';
		}
		//当前
		let year = y || (new Date().getFullYear());
		let month = m || (new Date().getMonth() + 1);

		// curMonth.value = month;
		// 总天数
		let date = new Date(year, month, 0);
		let days = date.getDate();
		// 第一天/最后一天星期几
		let whichFirstDay = new Date(year, curMonth.value - 1, 1).getDay();
		let whichLastDay = new Date(year, curMonth.value, 0).getDay();
		// let wk = whichFirstDay;
		console.log('总天数-第一天-最后一天', days, whichFirstDay, whichLastDay);
		// 随机生成状态的函数
		// if (!res) {
		// 	let curday = new Date().getDate();
		// 	console.log('curday', curday)
		// 	for (let i = 1; i <= days; i++) {
		// 		wk = wk > 6 ? 0 : wk
		// 		let listItem = {
		// 			actnums: 0,
		// 			day: i,
		// 			isToday: curday == i ? 'true' : 'false',
		// 			status: null,//986 可约 987 已约 988 完成了
		// 			sxp_date: year + '-' + month + '-' + (i < 10 ? '0' + i : i),
		// 			week: weekDays[wk],
		// 			can_pre_morning_nums: 0,
		// 			can_pre_night_nums: 0,
		// 			can_pre_noon_nums: 0,
		// 			is_pre_morning_nums: 0,
		// 			is_pre_night_nums: 0,
		// 			is_pre_noon_nums: 0,
		// 			morning_money: null,
		// 			morning_nums: 0,
		// 			night_money: 0,
		// 			night_nums: 0,
		// 			noon_money: 0,
		// 			total_money: 0,
		// 			total_nums: 0
		// 		};
		// 		dayListItem.push(listItem);
		// 		wk++
		// 	}
		// }
		// 日历-获取默认展示列表
		fillWeekList(dayListItem, source);
		let nlfirstDay = whichFirstDay == 0 ? 6 : Number(whichFirstDay) - 1;
		for (let i = 0; i < nlfirstDay; i++) {
			dayListItem.unshift({ space: true, num: '' });
		}
		let nlastDay = whichLastDay == 0 ? 0 : 7 - Number(whichLastDay);
		for (let i = 0; i < nlastDay; i++) {
			dayListItem.push({ space: true, num: '' });
		}
		// for (let i = 0; i < whichFirstDay; i++) {
		// 	dayListItem.unshift({ space: true, num: '' });
		// }
		// // rlClass.value = dindex>=0?dindex + whichFirstDay - 1:0;
		// let nlastDay = whichLastDay == 0 ? 6 : 7 - (Number(whichLastDay) + 1);
		// for (let i = 0; i < nlastDay; i++) {
		// 	dayListItem.push({ space: true, num: '' });
		// }
		console.log('dayListItem---', dayListItem);
		// calenList.value = dayListItem;
		hasFillCalen.value = true;
		swiperList.value[curSwiperIndex.value] = dayListItem;
	}
	//默认展示一周
	const fillWeekList = (list : any = [], source : any = '') => {
		console.log('fillWeekList', source);
		let nlist = list;
		if (source == 'def') {
			nlist = nlist.filter(ditem => !ditem.space)
		}
		let dindex = nlist.findIndex(ditem => !curDay.value ? ((ditem.isToday === 'true' || ditem.isToday === true) && ditem.status) : (ditem.status && (source == 'init' ? cachPreDay.value == ditem.day : curDay.value == ditem.day)));//今日index
		dindex < 0 ? dindex = nlist.findIndex(ditem => ditem.status) : '';
		let defindex = dindex >= 0 ? dindex : 0;//dindex >= 0 ? dindex : nlist.findIndex(ditem => !ditem.space)||
		// 获取默认展示列表s
		let defList = [], ys = nlist.length - defindex;
		for (let i = 0; i < 7; i++) {
			if (ys >= 7) {
				defList.push(nlist[defindex + i])
			} else {
				defList.push(nlist[defindex - (7 - ys) + i])
			}
		}
		weekend.value = defList;//默认展示一周
		weekClass.value = defList.findIndex(ditem => ditem.isToday === 'true' || ditem.isToday === true);
		let curd = nlist[defindex] || {};
		curDay.value = curd.day;
		cachPreDay.value = curd.day;
		curDate.value = dindex >= 0 ? curd.sxp_date || '' : '';//今日date curd?curd.split('-').join(''):''
		curStatus.value = curd.status || '';
		curSelect.value = curd || {};
		console.log('defList', defList, dindex, curDay.value, weekClass.value)
		// 获取默认展示列表e
	}
	// 控制轮播
	// const conTrswStatu = (v:any)=>{
	// 	// swcircular.value = v;
	// 	// if(curSwiperIndex.value==0||curSwiperIndex.value==2||swcircular.value){
	// 	// 	swcircular.value = v
	// 	// }
	// }

	// 日历
	const calenderSwiper = (e : any) => {
		hideCal();
		let index = e.detail.current;
		let ardate = curDefDate.value ? curDefDate.value.split('-') : []; //今日
		console.log('calenderSwiper', ardate)
		let y = ardate[0] || '', m = ardate[1] || '';//0-2   2-0
		// index==0&&curSwiperIndex.value>=2 //右
		// index==2&&curSwiperIndex.value<=0 //左边Math.abs() 
		const step = index - curSwiperIndex.value;
		const isAdd = step > 0 && step <= 1 || step == -2;
		isAdd ? nextMonth(y, m, index) : prevMonth(y, m, index);
		loadData('swiper');
		console.log('calenderSwiper++', isAdd, swiperList.value)
	}
	//切换月份
	const prevMonth = (y : any = '', m : any = '', index : any = 1) => {
		// let current = new Date(curYear.value, curMonth.value - 1, 1);
		let current = new Date(y, m - 1, 1);
		current.setMonth(current.getMonth() - 1);
		curYear.value = current.getFullYear();
		curMonth.value = current.getMonth() + 1;
		initCalenList(curYear.value, curMonth.value, index);
		console.log('curYear.value, curMonth.value-------------------------', curYear.value, curMonth.value)
	};

	const nextMonth = (y : any = '', m : any = '', index : any = 1) => {
		// let current = new Date(curYear.value, curMonth.value - 1, 1);
		let current = new Date(y, m - 1, 1);
		current.setMonth(current.getMonth() + 1);
		curYear.value = current.getFullYear();
		curMonth.value = current.getMonth() + 1;
		initCalenList(curYear.value, curMonth.value, index);
		console.log('curYear.value, curMonth.value-------------------------', curYear.value, curMonth.value)
	};

	//日历-默认
	const initCalenList = (y : any = null, m : any = null, index : any = 1, source : any = '') => {
		// 处理月份越界的情况
		if (m && m < 1) {
			m = 12;
			y--;
		} else if (m && m > 12) {
			m = 1;
			y++;
		}

		let dayListItem = [];
		//当前
		let year = y || (new Date().getFullYear());
		let month = m || (new Date().getMonth() + 1);
		curMonth.value = month;
		curYear.value = year;
		// 总天数
		let date = new Date(year, curMonth.value, 0);
		let days = date.getDate();
		// 第一天/最后一天星期几
		let whichFirstDay = new Date(year, curMonth.value - 1, 1).getDay();
		let whichLastDay = new Date(year, curMonth.value, 0).getDay();
		let wk = whichFirstDay;
		console.log('总天数-第一天-最后一天', days, whichFirstDay, whichLastDay);
		// 随机生成状态的函数
		// let curday = new Date().getDate();
		// console.log('curday', curday)
		for (let i = 1; i <= days; i++) {
			wk = wk > 6 ? 0 : wk
			let listItem = {
				actnums: 0,
				day: i,
				isToday: 'false',
				status: null,//986 可约 987 已约 988 完成了
				sxp_date: year + '-' + (month < 10 ? '0' + month : month) + '-' + (i < 10 ? '0' + i : i),
				week: weekDays[wk],
				can_pre_morning_nums: 0,
				can_pre_night_nums: 0,
				can_pre_noon_nums: 0,
				is_pre_morning_nums: 0,
				is_pre_night_nums: 0,
				is_pre_noon_nums: 0,
				morning_money: null,
				morning_nums: 0,
				night_money: 0,
				night_nums: 0,
				noon_money: 0,
				total_money: 0,
				total_nums: 0,
				isdefault: true
			};

			dayListItem.push(listItem);
			wk++
		}
		// 每一行最后一天周日
		curDefDate.value = dayListItem[0].sxp_date;
		let nlfirstDay = whichFirstDay == 0 ? 6 : Number(whichFirstDay) - 1;
		for (let i = 0; i < nlfirstDay; i++) {
			dayListItem.unshift({ space: true, num: '' });
		}
		let nlastDay = whichLastDay == 0 ? 0 : 7 - Number(whichLastDay);
		for (let i = 0; i < nlastDay; i++) {
			dayListItem.push({ space: true, num: '' });
		}
		// 每一行最后一天周六
		// for (let i = 0; i < whichFirstDay; i++) {
		// 	dayListItem.unshift({ space: true, num: '' });
		// }
		// // rlClass.value = dindex>=0?dindex + whichFirstDay - 1:0;
		// let nlastDay = whichLastDay == 0 ? 6 : 7 - (Number(whichLastDay) + 1);
		// for (let i = 0; i < nlastDay; i++) {
		// 	dayListItem.push({ space: true, num: '' });
		// }

		console.log('dayListItem---------------', dayListItem);
		dayListItem.length > 35 ? (filcalen.value = true) : (filcalen.value = false);
		// calenList.value = dayListItem;		
		swiperList.value[index] = dayListItem;
		curSwiperIndex.value = index;
	}
	// 预约弹窗一周//2
	const getClassNew = (status : any) => {
		return {
			bgHover: status == '987',
			// borderHover: status == 0,
			fontSizes: status == '987',//1
			border999: status == '986'//2
		}
		//吃过了 0  1 预约了  2待预约     986 可约 987 已约 988 完成了
	}
	//修改数量-number
	const changeNum = (e : any) => {
		console.log('changenum+', e, e.sku.num);
		const csku = e.sku.sku || '', citem = e.sku, cnum = e.nums;
		// if(getRemainNum(citem)){}
		// getSmaxNum(item)//最大数：需根据当前组的商品总数与组允许的最大数动态变化
		let param = {
			findex: citem.findex,
			fname: citem.fname,//组名
			fminNums: citem.fminNums || 0,//组最小购买数量
			fmaxNums: citem.fmaxNums || 0,
			fReplace: citem.fReplace,//组是否可更换商品
			sminNums: citem.sminNums,
			smaxNums: citem.smaxNums,
			isLock: citem.isLock,//锁
			isMust: citem.isMust,//是否必须购买
			isBuyMore: citem.isBuyMore,//是否允许多买
			isTaoCan: true,//是否套餐商品
			name: citem.goodsname || '',
			img: citem.vimage || citem.vmaster_product_image_id || '',
			nums: cnum,
			goods_id: citem.goods_id,
			sku: citem.sku,
			labelIds: citem.labelIds || [],
			nprice: (shopStore.costPlan == '1130' ? citem.sxp_site_sell_price ?? 0 : citem.sxp_out_sell_price ?? 0),
			storeNum: citem.nsell_nums || 0,
			status: citem.sku_status
		}
		// if (citem.fmaxNums == 1) {
		// 	let list = sxpGroupList.value[citem.findex].specList || [];
		// 	list.forEach(litem => {
		// 		citem.sku && citem.sku != litem.sku ? litem.num = 0 : '';
		// 	})
		// }
		changeCar(csku, cnum, param);

		console.log('changenum', curAddLists.value);
		// initCarData();
		// curAddLists.value;
	}
	// 同步购物车商品
	const changeCar = (sku : any = '', num : any = 0, item : any) => {
		const caindex = curAddLists.value.findIndex(item => sku && sku == item.sku);
		caindex >= 0 ? (num <= 0 ? curAddLists.value.splice(caindex, 1) : curAddLists.value[caindex].nums = num) : curAddLists.value.push(item);
		// item.fmaxNums==1
		// 重置组商品/购物车数量
		const needRz = needRzNum(item);
		let group = ruleGoup.value;
		console.log('remain++', caindex, needRz, group, group[item.goods_id].tnums)
		if (needRz) {
			let changed = false;
			let index = sxpGroupList.value.findIndex(fitem => fitem.goods_id == item.goods_id);
			let ngoods = index >= 0 ? sxpGroupList.value[index].specList || [] : [];//组
			console.log('index-ngoods', index, ngoods)
			let needN = num;
			if (ngoods.length > 0) {
				for (let i = 0; i < ngoods.length; i++) {
					let nitem = ngoods[i];
					console.log('index-ngoods1', nitem, nitem.num, sku != nitem.sku)
					if (nitem.num && sku != nitem.sku && !nitem.isLock) {
						changed = true;
						console.log('index-ngoods2', nitem.num, sku != nitem.sku)
						if (needN > nitem.num) {
							needN = needN - nitem.num;
							nitem.num = 0;
							delCarItem(nitem, 'car');//删除购物车该商品
						}
						if (needN <= nitem.num) {
							nitem.num = nitem.num - needN;
							nitem.num <= 0 && delCarItem(nitem, 'car');//删除购物车该商品
							if (nitem.num > 0) {
								const cindex = curAddLists.value.findIndex(citem => citem.sku && citem.sku == nitem.sku);
								cindex >= 0 ? curAddLists.value[cindex].nums = nitem.num : '';
								console.log('index-ngoods111', nitem.num, cindex, curAddLists.value)
							}
							break
						}
					}

				}
			}
			console.log('替换商品', changed)
			if (!changed && 0) {
				// 暂-替换商品
				let hindex = curAddLists.value.findIndex(ritem => ritem.replaceGroupId);
				console.log('替换商品0', hindex)
				if (hindex >= 0) {
					let carItem = curAddLists.value[hindex]
					if (needN > carItem.nums) {
						console.log('替换商品1')
						curAddLists.value.splice(hindex, 1);//删除购物车该商品
					}
					if (needN <= carItem.nums) {
						console.log('替换商品2')
						carItem.nums = carItem.nums - needN;
					}
				}

			}


		}
		// 更新goods_id分组
		upGoodGoups()
		// for (let key in group) {
		// 	group[key].tnums = 0; 
		// 	for (let i = 0; i < curAddLists.value.length; i++) {
		// 		 curAddLists.value[i].goods_id==key?group[key].tnums+=curAddLists.value[i].nums:'';
		// 	}
		// 	// let mindex = curAddLists.value.findIndex(c=>c.goods_id==key)
		// 	// mindex>=0?group[key].tnums+=curAddLists.value[mindex].nums:'';
		// }
		// curAddLists.value.forEach(citem=>{
		// 	group[citem.goods_id].tnums = 0;
		// 	if(group[citem.goods_id]){
		// 		group[citem.goods_id].tnums+=citem.nums;
		// 	}
		// })
		// ruleGoup.value = group;//当前购物车数量按goods_id分组
		console.log('同-步购物车商品', curAddLists.value)
		console.log('同-步购物车goods_id分组', group)
	}
	// 更新goods_id分组
	const upGoodGoups = () => {
		let group = ruleGoup.value;
		for (let key in group) {
			group[key].tnums = 0;
			for (let i = 0; i < curAddLists.value.length; i++) {
				curAddLists.value[i].goods_id == key || curAddLists.value[i].replaceGroupId == key ? group[key].tnums += curAddLists.value[i].nums : '';
			}
		}
		console.log('更新goods_id分组', group)
	}
	// const changeNums1 = (list : any = [], sku : any, num : any) => {
	// 	let nindex = list.findIndex(nitem => sku != nitem.sku && nitem.num > 0);
	// 	console.log('index-ngoods1', nindex)
	// 	if (nindex >= 0) {
	// 		let group = ruleGoup.value;
	// 		let nitem = list[nindex];//修改商品数量
	// 		let cnm = group[nitem.goods_id].tnums - num;
	// 		console.log('index-ngoods2', group, cnm)
	// 		nitem.num = cnm >= 0 ? cnm : 0;//自动调整修改组商品数量-规则，从左到右替换商品数量
	// 		let cindex = curAddLists.value.findIndex(citem =>item.goods_id == citem.goods_id && citem.sku == list[nindex].sku);
	// 		cindex >= 0 ? nitem.num <= 0 ? curAddLists.value.splice(cindex, 1) : curAddLists.value[cindex].nums = nitem.num : '';
	// 	}
	// }
	//  changeModalNum
	// 规格弹窗-修改数量
	const confirmModalNum = (e) => {
		changeListNums(e.sku, e.nums)
	}
	// 规格弹窗-删除指定商品
	const modalDel = (e) => {
		console.log('modalDel', e)
		delCarItem(e)
	}

	// 同步商品列表数量
	const changeListNums = (sku : any = '', num : any = 0) => {
		let zskus : any = {};//购物车sku分组
		if (sku == 'init') {
			zskus = getGroups()
		}
		console.log('zskus', zskus)
		sxpGroupList.value.forEach(item => {
			let clist = item.specList || [];
			for (let i = 0; i < clist.length; i++) {
				let citem = clist[i];
				if (sku === 'init') {
					citem.num = zskus[citem.sku] ? zskus[citem.sku].num : 0;
				}
				if (sku != 'init' && citem.sku == sku) {
					citem.num = num;
					break;
				}

			}

		})
	}
	// 删除购物车数据-购物车删除
	const delCarItem = (item : any, source : any = '') => {
		// item.nums = 0;
		console.log('delCarItem', item);
		const cindex = curAddLists.value.findIndex(citem => citem.sku && citem.sku == item.sku);
		cindex >= 0 ? curAddLists.value.splice(cindex, 1) : '';
		source != 'car' && upGoodGoups();//更新good_id分组
		source != 'car' && changeListNums(item.sku, 0);
		// selecttData.value.sList.splice(index, 1)
		// let cindex = carList.value.findIndex(citem => citem.id == item.id)
		// cindex >= 0 && carList.value.splice(cindex, 1)
	}
	// 清空
	const tapClearCar = () => {

		clearCar()//暂

		// selecttData.value.sList = []
		// mealList.value.forEach(item => {
		// 	item.tabList.forEach(j => {
		// 		// j.num > 0 ? (totalMoney += ((parseFloat(j.price) || 0) * (j.num || 0))) : "";
		// 		j.select = false
		// 		j.num = 0
		// 	});
		// });
		// curList.value = []
		// goodList.value.forEach(item => {
		//   item.num = 0
		//   item.select = false
		// })
	}
	const clearCar = () => {
		uni.showModal({
			title: '提示',
			content: '确定清空当前购物车么',
			confirmText: '确定',
			confirmColor: '#2AB05E',
			success: async res => {
				if (res.confirm) {
					try {
						curAddLists.value = curAddLists.value.filter(item => item.isMust)
						sxpGroupList.value.forEach(item => {
							let clist = item.specList || [];
							clist.forEach(j => {
								j.select = false
								j.num = 0
							});
						});

						// showLoading()
						// let params : any = {}
						// // cartStore.curOrderType && cartStore.curOrderType.type ? params.patten = cartStore.curOrderType.type : ''
						// let res = await clearCart(params)
						// hideLoading()
						// if (res.result) {
						// 	// initCar()
						// 	// emit("carNumChanges")
						// } else {
						// 	mApi.msg(res.shortMessage || '网络繁忙，请稍后再试!', res.code)
						// 	hideLoading()
						// }
					} catch (e) {
						console.error(e)
						// hideLoading()
						// mApi.msg('网络繁忙，请稍后再试!')
					}

				}
			}
		})
	}
	const canRepeat = ref(true)
	//提交、取消按钮-提交订单
	const tapSubmit = () => {
		// curStatus.value == '987' && item.total_nums > 0 || curSelect.value.total_nums
		if (curStatus.value == '987' && submiType.value.status == 'qx') {
			// 取消约餐-7
			let list : any = [], tnums = 0, timeRange : any = [], id = navlist.value[navClass.value].id;
			console.log('tapppssss', id)
			if (curSelect.value.is_pre_morning_nums > 0) {
				tnums += curSelect.value.is_pre_morning_nums;
				timeRange.push('1186');
				list.push({
					id: '1186',
					state: id && id == '1186' ? true : false,
					nums: curSelect.value.is_pre_morning_nums || 0,
					text: '取消早餐'
				})
			}
			if (curSelect.value.is_pre_noon_nums > 0) {
				tnums += curSelect.value.is_pre_noon_nums;
				timeRange.push('1187');
				list.push({
					id: '1187',
					state: id && id == '1187' ? true : false,
					nums: curSelect.value.is_pre_noon_nums || 0,
					text: '取消中餐'
				})
			}
			if (curSelect.value.is_pre_night_nums > 0) {
				timeRange.push('1188');
				tnums += curSelect.value.is_pre_night_nums;
				list.push({
					id: '1188',
					state: id && id == '1188' ? true : false,
					nums: curSelect.value.is_pre_night_nums || 0,
					text: '取消晚餐'
				})
			}
			timeRange.length > 1 && list.unshift({
				id: timeRange.join(','),
				state: false,
				nums: tnums || 0,
				text: '取消全天'
			})
			cancelData.value = list;
			console.log('cancelData', list)
			showPop('pop3')
			return
		}
		if (!canRepeat.value) {
			return
		}
		canRepeat.value = false;
		setTimeout(() => {
			canRepeat.value = true;
		}, 800)
		// 约餐
		submiType.value.status == 'ky' && confirmAct();

		// addCart()
		// if (hasRecord.value) {
		// 	uni.setStorageSync('fromPages', 'meal')//暂时
		// 	mnavTo('/pages/order/creatOrder/creatOrder')
		// 	return
		// }
	}
	const confirmAct = () => {
		// curSelect.value
		// navlist navClass
		console.log('confirmAct0', curSelect.value)
		console.log('confirmAct1', navlist.value, navClass.value)
		let h = hasCurMeal();
		if (!h.hasPre) {
			doConfirm()
			return
		}
		uni.showModal({
			title: '提示',
			content: `您已有今天${h.name}约餐记录，是否还需要继续约餐`,
			confirmText: '约餐',
			showCancel: true,
			success: res => {
				if (res.confirm) {
					doConfirm()
				}
			}
		})
	}
	const hasCurMeal = () => {
		let r = { hasPre: false, name: '' };
		let curTimeId = navlist.value && navlist.value[navClass.value] ? navlist.value[navClass.value].id : '';
		if (curTimeId && curSelect.value) {
			if (curTimeId == '1186' && curSelect.value.is_pre_morning_nums > 0 || curTimeId == '1187' && curSelect.value.is_pre_noon_nums > 0 || curTimeId == '1188' && curSelect.value.is_pre_night_nums > 0) {
				r = { hasPre: true, name: navlist.value[navClass.value].name }
			}
		}
		return r

	}
	//约餐
	const doConfirm = async () => {
		try {
			if (haSubmited.value) {
				mApi.msg("请勿重复提交哦")
				return
			}
			if (!verticalParams()) {
				return
			}
			console.log('submiType+', submiType.value);
			console.log('doConfirm', curAddLists.value);
			let det : any = [];
			curAddLists.value.forEach(item => {
				if (item.nums > 0) {
					let sub : any = {
						dynamic_conver_group_id: item.replaceSku || item.addGroupId ? item.replaceGroupId || item.addGroupId || '' : item.goods_id || '',//多套更多商品手动加入组
						sku: item.sku || 'MF001',
						nums: item.nums || 1,
						labelIds: item.labelIds,
						sxpGoods: true
					}
					item.replaceSku ? sub.dynamic_conver_sku = item.replaceSku : '';
					det.push(sub)
				}
			})
			let params : any = {
				dynamic_id: mealDetail.value.goods_id || '',
				vipCredCoupon: '6',
				details: det,
				nums: 1
				// patten:'',//COMMON/SUBSCRIBE
				// pointSellerMemberId:''//自提点
				// special_id:''//专区ID
			};
			if (cartStore.curOrderType && cartStore.curOrderType.type) {
				params.patten = cartStore.curOrderType.type;
				params.subsTime = cartStore.curOrderType.time.dateString;
			}
			showLoading();
			let res = await submitBuyingMealsNow(params);
			hideLoading()
			if (!res.result || !res.object) {
				mApi.msg(res.shortMessage || '网络繁忙，请稍后', res.code)
				return
			}
			// 清除购物车
			// 	uni.setStorageSync('fromPages', 'meal')//暂时
			cartStore.setManyParams(params);
			let rDate = curDate.value ? curDate.value.split('-').join('') : '';
			cacheListGroups();//去约餐缓存购物车
			hideCal();
			mnavTo(`/pages/order/creatOrder/creatOrder?orderType=manyMeals&hasRecord=true&fbillId=${fbillId.value}&rangeType=${navlist.value[navClass.value].id}&goodsId=${curGoodsId.value}&dayDate=${rDate}`)

		} catch (e) {
			console.error(e)
		}

	}
	// 添加购物车商品
	const curAddLists = ref<any>([]);
	const haSubmited = ref(false)
	// const initParams = (arr : any = []) => { }

	//添加购物车-暂7
	const addCart = async () => {
		if (haSubmited.value) {
			mApi.msg("请勿重复提交哦")
			return
		}
		if (!verticalParams()) {
			return
		}
		try {
			let res : any = null, det : any = [];
			if (curAddLists.value.length <= 0) {
				mApi.msg("请选择商品")
				return
			}
			curAddLists.value.forEach(item => {
				if (item.nums > 0) {
					let sub : any = {
						dynamic_conver_group_id: item.replaceSku ? item.replaceGroupId || '' : item.goods_id || '',
						sku: item.sku || 'MF001',
						nums: item.nums || 1,
						labelIds: item.labelIds
					}
					item.replaceSku ? sub.dynamic_conver_sku = item.replaceSku : '';
					det.push(sub)
				}
			})
			const params : any = {
				dynamic_id: mealDetail.value.goods_id || '',//随心配套商品ID SP20240823149803
				nums: 1,
				// patten:'SUBSCRIBE',
				details: det,
				// dpsku:['MF001','FQJD001'],//随心配加入的SKU,数组
				// dpnums:[1,2],//随心配加入的SKU,数组
				// labelIds: item.labelIds || []
			};
			// const params : any = item.isVip == '1' ? { ...baseParams, special_id: item.specialId } : { ...baseParams };
			if (cartStore.curOrderType && cartStore.curOrderType.type) {
				params.patten = cartStore.curOrderType.type;
				params.subsTime = cartStore.curOrderType.time.dateString
			}
			showLoading();
			res = await addMealCart(params);
			hideLoading()
			if (res && res.result) {
				haSubmited.value = true;
				let obj = { id: '6', source: 'singleMeal', action: 'addTCars' }
				uni.setStorageSync('menuact', obj)
				mApi.msg("加入购物车成功!")
				uni.navigateBack()
			} else {
				mApi.msg(res.shortMessage || "加入购物车失败!", res.code)

			}
		} catch (e) {
			hideLoading()
			console.error(e)
		}
	}
	const verticalParams = () => {
		let group = ruleGoup.value, msg = '', vtc = true;
		// curAddLists.value.forEach(item=>{
		// 	!group[item.goods_id]?group[item.goods_id] = {tnums:item.nums,...item}:group[item.goods_id].tnums+=item.nums;
		// })
		for (let key in group) {
			let citem = group[key];
			if (citem.tnums < citem.fminNums || (citem.nums <= 0 && citem.isMust)) {
				msg = (citem.nums <= 0 && citem.isMust) ? '必选菜' + citem.name + (citem.storeNum <= 0 || citem.storeNum < citem.sminNums ? '库存不足' : '已下架') + '无法约餐' : '请添加' + citem.fname + '商品哦';
				vtc = false
				break
			}
		}
		mApi.msg(msg);
		console.log('verticalParams', group, vtc);
		return vtc
	}

	// 自动约餐确认
	const sureAuto = (param : any) => {
		selfParams.value = param.list;
	}
	const showPop = (source : string, item : any = {}) => {
		console.log('showPop', item)
		switch (source) {
			case 'pop1':
				// let rDate = curDefDate.value ? curDefDate.value.split('-').join('') : '';
				// 暂
				pop1.value?.open(curGoodsId.value, fbillId.value)
				break;
			case 'pop2':
				if (!item.isBuyMore) {
					//不允许多买
					return
				}
				let sxpNums = ruleGoup.value[item.goods_id].tnums;//当前组总数
				let max = item.fmaxNums - sxpNums - item.nums;
				pop2.value?.open(item, max)
				break;
			case 'pop3':
				pop3.value?.open()
				break;
			case 'pop4':
				pop4.value?.open()
				break;
			case 'editProp':
				editProp.value?.open()
				break;
			case 'deliveryTime':
				deliveryTime.value?.open()
				break;
			case 'mealMate':
				mealMate.value?.open()
				break;
			default:
				break;
		}
	}
	const hidePop = (source : string) => {
		switch (source) {
			case 'pop1':
				pop1.value?.close()
				break;
			case 'editProp':
				editProp.value?.close()
				break;
			case 'deliveryTime':
				deliveryTime.value?.close()
				break;
			case 'mealMate':
				mealMate.value?.close()
				break;
			case 'pop2':
				pop2.value?.close()
				break;
			case 'pop3':
				pop3.value?.close()
				break;
			case 'pop4':
				pop4.value?.close()
				break;
			default:
				break;
		}
	}
	// const tapdMeal = (item : AnyObject, list : AnyObject) => {
	// 	if (item.select) {
	// 		item.select = false
	// 		return
	// 	}
	// 	list.forEach((citem) => {
	// 		citem.select = false
	// 	})
	// 	item.select = !item.select
	// }

	// const tap-CalItem1 = (event) => {
	// 	// const { width, height } = event.target.getBoundingClientRect();
	// 	// const rect = event.target.getBoundingClientRect();
	// 	console.log('tapcal', event);
	// 	// console.log('tapcal',event,width,height);
	// 	// tapcalx
	// }
	// const sys = uni.getSystemInfoSync();
	// const windowWidth = sys.windowWidth;
	// const windowHeight = sys.windowHeight;
	//取消约餐
	// const rlClass = ref<any>(null);
	const isPerfect = (t : any = 0, m : any = 0, n : any = 0, w : any = 0) => {
		let r = false, nt = m + n + w;

		if (t > 0 && nt > 0) {
			r = t >= nt;
		}
		return r
	}
	const weekClass = ref(0);
	// 日历
	const tapCalItem = async (item : any, index : any, event : any, type : any = '') => {
		console.log('tapCalItem-event', item)
		// rlClass.value = index;
		// rlClass.value = rlClass.value==index?null:index;
		// 986 可约 987 已约 988 完成了
		// 取消&& item.status != '988' 

		if ((curDate.value == item.sxp_date && (type == 'week' ? showWkSub.value : showCalSub.value)) || item.space) {
			calMealDetail.value.length > 0 && !item.space ? (type == 'week' ? showWkSub.value = !showWkSub.value : showCalSub.value = !showCalSub.value) : hideCal();
			return
		}
		hideCal();
		if (!item.status) {
			mApi.msg("当日无订餐计划")
			return
		}
		type == 'week' ? weekClass.value = index : '';
		curDate.value = item.sxp_date || '';
		curStatus.value = item.status || '';
		curSelect.value = item || {};
		curDay.value = item.day;

		let source = 'tap';
		try {
			// item.status == '988'
			if ((type == 'week' ? !showWkSub.value : !showCalSub.value) && event) {
				const nowDate = curDate.value ? curDate.value.split('-').join('') : '';
				const ndata = {
					goodsId: curGoodsId.value || '',
					nowDate: nowDate,
					fatherBillId: fbillId.value
				}
				showLoading();
				source = 'tap-md';
				let res = await getCalDetail(ndata);
				hideLoading();
				if (!res.result || !res.object) {
					mApi.msg(res.shortMessage || '网络繁忙，请稍后.')

				}
				calMealDetail.value = res.object || [];
				let totM = 0;
				calMealDetail.value.forEach(citem => {
					totM += citem.ntotal_money || 0;
				})
				calDetailTmoney.value = totM.toFixed(2);
				nextTick(() => {
					calMealDetail.value.length > 0 && clientView(event, type);
				})

			}
			navClass.value = 0;
			item.status && loadData(source);
		} catch (e) {
			hideLoading();
			console.error(e)
		}
	}
	// 查看订单
	const tapToOrderList = () => {
		uni.setStorageSync('index_key', '0');
		uni.switchTab({
			url: '/pages/index/order/order'
		})
	}
	const hideCal = () => {
		showCalSub.value ? showCalSub.value = false : '';
		showWkSub.value ? showWkSub.value = false : '';
	}

	// 周
	// const tapWItem = async (item : any, index : any, event : any) => {
	// 	// 986 可约 987 已约 988 完成了
	// 	if (curDate.value == item.sxp_date || item.space) {
	// 		hideCal();
	// 		return
	// 	}
	// 	if (!item.status) {
	// 		hideCal();
	// 		mApi.msg("当日无订餐计划")
	// 		return
	// 	}
	// 	curDate.value = item.sxp_date || '';
	// 	curStatus.value = item.status || '';
	// 	curSelect.value = item || {};
	// 	if (item.status == '988') {
	// 		const nowDate = curDate.value ? curDate.value.split('-').join('') : '';
	// 		const ndata = {
	// 			goodsId: curGoodsId.value || '',
	// 			nowDate: nowDate
	// 		}
	// 		hideCal();
	// 		let res = await getCalDetail(ndata);
	// 		clientView(event);
	// 		// !showCalSub.value ? clientView(event) : showCalSub.value = false;
	// 		return
	// 	}
	// 	hideCal();
	// 	// total_nums
	// 	if (item.status == '987') {
	// 		// showPop('pop3')
	// 		copywriting.value = '取消';
	// 	}
	// 	(item.status && item.status != '988') && loadData();
	// }
	const showWkSub = ref(false);
	const wkSubBoxH = ref(0);
	// 计算弹窗高度
	const clientView = (event : any, type : any = '') => {
		// copywriting.value = '约餐'
		const cur = event.currentTarget;
		let oflef = cur.offsetLeft, oftop = cur.offsetTop;
		tapcaly.value = oftop + uni.upx2px(80);
		tapcalx.value = oflef + uni.upx2px((type == 'week' ? 0 : 25));//49 - 10 - 14 = 25
		const qrcs = uni.createSelectorQuery();
		qrcs.select('.csfmain').boundingClientRect();
		// let boxH = 0;
		qrcs.exec((res) => {
			if (res[0]) {
				// res[0]即为所需的元素信息
				console.log('boxH000', res)
				// boxH = res[0].height
				console.log(`宽度000: ${res[0].width}px, 高度000: ${res[0].height}px`);
				wkSubBoxH.value = res[0].height + uni.upx2px(20);
				type == 'week' ? showWkSub.value = true : showCalSub.value = true;
			}
		});
		// const query = uni.createSelectorQuery();
		// query.select('.mcitm').boundingClientRect(); // 选择类名为my-element的元素
		// query.exec((cres) => {
		// 	if (cres[0]) {
		// 		// cres[0]即为所需的元素信息
		// 		type == 'week' ? showWkSub.value = true : showCalSub.value = true;
		// 		console.log(`宽度: ${cres[0].width}px, 高度: ${cres[0].height}px`, cres, event);

		// 	}
		// });

	}
	// 取消约餐
	const tapCancelModal = async () => {
		let index = cancelData.value.findIndex(item => item.state);
		if (index < 0) {
			mApi.msg('请选择取消约餐')
			return
		}
		const item = cancelData.value[index] || {};
		let nowDate = curDate.value ? curDate.value.split('-').join('') : '';
		try {
			let res = await cancelMeals({ goodsId: curGoodsId.value || '', sxp_time: nowDate, rangeType: item.id, fatherBillId: fbillId.value });
			if (!res.result) {
				mApi.msg(res.shortMessage || '网络繁忙，请稍后.')
			}
			hidePop('pop3')
		} catch (e) {
			console.error(e)
		}

	}
	// 获取一个目标元素
	// const getElRect = (elClass, dataVal) => {
	// 	new Promise((resolve, reject) => {
	// 		const query = uni.createSelectorQuery().in(this);
	// 		query.select('.' + elClass).fields({size: true},res => {
	// 			// 如果节点尚未生成，res值为null，循环调用执行
	// 			if(!res) {
	// 				setTimeout(() => {
	// 					// getElRect(elClass);
	// 				}, 10);
	// 				return ;
	// 			}
	// 			console.log('elClass',elClass,res)
	// 			// state[dataVal] = res.height;
	// 		}).exec();
	// 	})
	// }	
	const tapShopItem = () => {
		// mnavTo('/pages/order/setMeal/setMeal?hasRecord=true')
		mnavTo(`/pages/order/goodsDetial/goodsDetial?shopType=2&goodsId=${mealDetail.value.goods_id}&goodsSku=`)
		// uni.navigateTo({
		//   url: '/pages/order/goodsDetial/goodsDetial?shopType=1'
		// })
	}
	const tapItemSelec = (item : any) => {
		item.select = !item.select
		item.select ? item.num = 1 : item.num = 0
		//暂
		// let cindex = goodList.value.findIndex(citem=>citem.id==item.id)
		// if(cindex>=0){
		// let nitem = goodList.value[cindex]
		// nitem.select=!nitem.select
		// nitem.select?nitem.num=1:nitem.num=0
		// }
	}
	// 获取商品列表组信息及缓存更多交互数据
	const cacheListGroups = (obj : any = {}, goodsId : any = '') => {
		console.log('cacheListGroups', obj, curDate.value)
		// [{
		// 	date:'',
		// 	range:'',
		// data
		// }]
		let skuGroup : any = {}, baseMoney = 0;
		sxpGroupList.value.forEach(citem => {
			let clist = citem.specList || [];
			clist.forEach(j => {
				!skuGroup[j.sku] ? skuGroup[j.sku] = { goods_id: j.goods_id, sku: j.sku, isTaoCan: true } : '';
			});
		})
		let marr = curAddLists.value.filter(citem => !citem.isTaoCan);
		let r = {
			source: obj.source,//更换-change
			changeGoupId: obj.source == 'replace' ? obj.goodsItem.goods_id : '',//更换商品detail
			type: curSingleMealType.value,
			baseMoney: baseMoney,
			cart: marr,
			skuGroup: skuGroup,
			groupId: goodsId
		}
		console.log('skuGroup0', r)
		console.log('gengduo1', ruleGoup.value)
		cartStore.setTsCarList(r.cart);
		cartStore.setTmoreDetail(r)
	}
	// 更多
	const getMores = (item : any) => {
		item && console.log('gengduo', item.goods_id, item)
		if (!sxpGroupList.value || sxpGroupList.value.length <= 0 || submiType.value.status != 'ky') {
			return
		}
		item && console.log('gengduo111', sxpGroupList.value, sxpGroupList.value[0].goods_id)
		cacheListGroups({}, item ? item.goods_id : sxpGroupList.value[0].goods_id)
		// return;
		mnavTo('/pages/order/moreMeal/moreMeal?source=manyMeal');
	}
	const handelPre = (tabList : any, index : any, item : any) => {
		let imageIds = tabList.map(item => imgBaseUrl.value + (item.vimage || item.vmaster_product_image_id || ''))
		console.log(item)
		uni.previewImage({
			current: imageIds[index],
			urls: imageIds,
			success: () => {
				console.log("111")
			}
		})
	}
	// 下拉-s
	const listTouchStart = ref(0);
	const listTouchDirection = ref(null);
	const touchS = ref([0, 0]);
	const touchE = ref([0, 0]);
	const isDoublefinger = ref(false)
	const modalTouchStart = (e)=> {
		// console.log('tstart',e)
		e.touches.length>1?isDoublefinger.value = true:isDoublefinger.value = false;
		let sx = e.touches[0].pageX;
		let sy = e.touches[0].pageY;
		touchS.value = [sx, sy];
		// this.listTouchStart = e.touches[0].pageY;
	}
	const modalTouchMove = (e)=> {
		let sx = e.touches[0].pageX;
		let sy = e.touches[0].pageY;
		touchE.value = [sx, sy];
		console.log('modalTouchMove',e)
		listTouchDirection.value = e.touches[0].pageY- this.listTouchStart > 0? 'down' : 'up'; 
	}
	const modalTouchEnd = (e)=>{
		let start = touchS.value;
		let end = touchE.value;
		console.log('s',start)
		console.log('e',end)
		let dify = start[1] - end[1];
		let difx = start[0] - end[0];
		let isdow = (start[1] < end[1] - 50)&&Math.abs(dify)>0&&Math.abs(dify)>Math.abs(difx);
		// console.log('dow',listTouchDirection.value,isdow,Math.abs(dify)&&Math.abs(dify)>Math.abs(difx),start[1] < end[1] - 50)
		if (listTouchDirection.value == 'down'||isdow) {
			// this.componentHide()
			showCad.value = true;
			touchE.value = [0,0];
		} else {
			// this.modalName = null;
		}
		listTouchDirection.value = null;		
	}
	const stopPrevent = ()=>{}
	// 下拉-e
	// const handelPre = (tabList : any, index : any, item : any) => {
	// 	// console.log('item',item[index].img,item)
	// 	const imgList = mealList.value.flatMap(list => list.tabList.map(j => j.img))
	// 	// const imgList = item.map(list => list.img)
	// 	console.log('item', item.img)
	// 	uni.previewImage({
	// 		current: item.img,
	// 		urls: imgList,
	// 		success: () => {
	// 			console.log("111")
	// 		}
	// 	})
	// }
</script>

<style lang="scss" scoped>
	page {
		background-color: #f2f2f2;
	}

	.popup-content {
		background-color: #fff;
		border-radius: 36rpx;
		width: 530rpx;
		padding-bottom: 40rpx;
		flex-shrink: 0;

		.textprop {
			color: #333;
			font-family: "Microsoft YaHei UI";
			font-size: 32rpx;
			font-style: normal;
			font-weight: 400;
			line-height: normal;
		}

		.listyuecan {
			width: 190rpx;
			margin-bottom: 40rpx;
		}

		.gapmar {
			flex-wrap: wrap;
		}

		.mdbtn {
			width: 202rpx;
			height: 80rpx;
			flex-shrink: 0;
			border-radius: 5px;
			border: 1px solid #5DB175;
			background-color: #fff;

			&:nth-child(2) {
				background-color: #5DB175;
				color: #fff;
			}
		}

		.mainbox {
			width: 430rpx;
			min-height: 150rpx;
			margin: 0 auto;

			.martB {
				margin: 26rpx 0 32rpx;
				color: #333;
				font-family: "Microsoft YaHei UI";
				font-size: 32rpx;
				font-style: normal;
				font-weight: 400;
				line-height: 133%;
				/* 21.28px */
				letter-spacing: 0.32px;
			}

			&.ol {
				margin: 50rpx 0 32rpx;
			}
		}

		.popupEmil-btn {
			width: 430rpx;
			margin: 0 auto;
		}

		.mbprice {
			padding-top: 80rpx;
			font-size: 64rpx;
		}

	}

	.sizipic {
		color: #FFFDCA;
		font-family: "Microsoft YaHei UI";
		font-size: 16px;
		font-style: normal;
		font-weight: 700;
		line-height: normal;

		.ionc_pic {
			color: #FFFDCA;
			font-family: "Microsoft YaHei UI";
			font-size: 10px;
			font-style: normal;
			font-weight: 400;
			line-height: normal;
		}
	}

	.rotateStyleHover {
		transform: rotate(-90deg) !important;
		transition: all 0.3s ease !important;
	}

	.bg_container {
		padding: 50rpx 28rpx 20rpx;
		background: linear-gradient(180deg, #E4FEEE 5.33%, #FFF 100%);
		position: relative;
		box-shadow: 0 -5px 10px rgba(0, 0, 0, 0.1);
		// box-shadow:0 4px 8px rgba(1,33,18,.5);
		// fill: linear-gradient(180deg, #E4FEEE 4.33%, #FFF 70.35%);
		// filter: drop-shadow(0px 10rpx 30rpx rgba(0, 65, 92, 0.10));
		// fill: linear-gradient(180deg, #E4FEEE 4.33%, #FFF 50%);
		// filter: drop-shadow(0px -2px 15px rgba(0, 65, 92, 0.10));
	}

	.posiImg {
		position: absolute;
		top: -15rpx;
		left: 35rpx;
		width: 40rpx;
		height: 36rpx;
		transition: left 0.2s ease-out;

		&.lef0 {
			left: 40rpx;
		}

		&.lef1 {
			left: 145rpx;
		}

		&.lef2 {
			left: 246rpx;
		}

		&.lef3 {
			left: 350rpx;
		}

		&.lef4 {
			left: 456rpx;
		}

		&.lef5 {
			left: 560rpx;
		}

		&.lef6 {
			left: 670rpx;
		}

	}

	.listUl {


		// .cuIcon-check {
		// 	color: #fff;
		// }

		.borderLi {
			width: 68.77rpx;
			height: 66.86rpx;
			flex-shrink: 0;
			border-radius: 50%;
			font-family: "Microsoft YaHei UI";
			font-size: 28rpx;
			font-style: normal;
			font-weight: 400;
			line-height: normal;
			// color: #666;
			color: #999; //#CFCFCF

			&.gry {
				background: #EAEAEA; //rgba(234, 234, 234, 1)
				color: #fff;
			}

			&.ov {
				background: #EAEAEA;
				color: #999;
			}

			&.border999 {
				// border: 1px solid #999;
				border: 1px solid #CFCFCF;
			}

			&.bgHover {
				background-color: #53A87F;
				color: #fff;
			}

			&.fontSizes {
				font-size: 20rpx;
			}

			&.act {
				border: 4rpx solid #4CDD97;
				box-shadow: 0px 0px 10rpx 0px rgba(93, 177, 117, 0.2);
			}
		}

		.timeweek {
			font-size: 20rpx;
			margin-top: 10rpx;
			color: #999;
		}

		.timeweekHover {
			font-size: 20rpx;
			color: #fff;
		}
	}

	.recBox {
		top: -30rpx;
		z-index: 5;
	}

	.automatic_con {
		border-radius: 20px 20rpx 0 0;
		background: #FFF;
		box-shadow: 0px -4px 5px 0px rgba(1, 33, 18, 0.50); //-4px 10px
	}

	.paddingxxx {
		padding: 0 28rpx 20rpx;
	}

	.paddingdzih {
		padding: 0 28rpx 0;
	}

	.title_matic {
		height: 120rpx;
	}

	.text-xll {
		font-size: 35rpx;
	}

	.rotateStyle {
		transform: rotate(90deg);
		display: inline-block;
		transition: all 0.3s ease !important;
		margin-left: 20rpx;
	}

	// .activeList{
	//   border: 1px solid #53A87F !important;
	// }
	.activeText {
		color: #53A87F !important;
	}

	.screen-swiper {
		height: 475rpx;
		background: #fff;
	}

	.topSec {
		min-height: 210rpx; //310
		background: #53A87F;
		z-index: 1;
		padding-bottom: 50rpx;

		.tc_name {
			font-size: 48rpx;
		}
	}

	.container {
		background: #f2f2f2;
	}

	.textgd {
		color: #333;
		font-family: "Microsoft YaHei UI";
		font-size: 32rpx;
		font-style: normal;
		font-weight: 700;
		line-height: normal;
	}

	.text_price {
		color: #FC4C40;
		font-family: "Microsoft YaHei UI";
		font-size: 16px;
		font-style: normal;
		font-weight: 400;
		line-height: normal;
	}

	.numBox {
		// margin-top: -13rpx;
		padding-right: 16rpx;
	}

	.text_name {
		// color: #333;
		// font-family: "Microsoft YaHei UI";
		// font-size: 28rpx;
		// font-style: normal;
		// font-weight: 400;
		// line-height: normal;
		// margin: 10rpx 0;
		// display: inline-block;
	}

	.cenSec {
		min-height: 240rpx;
	}

	.leMeal_title {
		min-height: 110rpx;

		.textcolor3 {
			color: #333;
		}

		.swtich_menu {
			width: 258rpx;
			height: 48rpx;
			border-radius: 62rpx;
			border: 1px solid rgba(93, 177, 117, 0.27);
			padding: 0 7rpx;

			.font_style {
				color: #999;
				width: 128rpx;
				height: 36rpx;
				font-size: 24rpx;
				font-weight: 400;
				border-radius: 62rpx;
			}

			.active {
				color: #fff !important;
				background: #5DB175 !important;
			}
		}
	}

	.emptybx {
		position: absolute;
		top: 0;
		right: 0;
		width: 100%;
		height: 100%;
	}

	.singleMeal_box {
		width: 748rpx;
		// border-radius: 20px;//取消间隔-1
		background: #FFF;
		// margin-bottom: 30rpx;//取消间隔-1
		padding: 0 28rpx 20rpx;
		position: relative;
		z-index: 3;
		min-height: 240rpx;

		&.gry {
			background: #f2f2f2;
		}

		&:first-child {
			// box-shadow: 0px -4px 10px 0px rgba(1, 33, 18, 0.4);
			margin-top: -30rpx;
			// position: relative;
			// z-index: 88;
		}

		.mitem {
			width: 222rpx; //330
			min-height: 364rpx; //406
			margin: 0 12rpx 20rpx 0;

			&:nth-child(3n) {
				margin: 0 0 20rpx 0;
			}
		}

		.zitem {
			margin: 0 30rpx 20rpx 0;
			max-width: 100%;

			&.gry {
				.text_marleft {
					color: #c0c0c0;
				}
			}
		}

		.list_img {
			border-radius: 16rpx;

			&.bg {
				background: #fafafa;
			}

			.img_style {
				// width: 170rpx;//330rpx
				height: 180rpx; //320rpx
				flex-shrink: 0;
				position: relative;
			}

			.img_wh {
				border-radius: 30rpx;
				width: 180rpx;
				height: 180rpx;
			}

			.act {
				.list_border {
					border: 1px solid #53A87F;
					background: rgba(228, 248, 228, 0.50);
				}

				.spctext {
					color: #53A87F;
				}
			}
		}


	}

	.specifications {
		position: absolute;
		bottom: 0;
		right: 0;
		padding: 0 24rpx;
		height: 50rpx;
		flex-shrink: 0;
		border-radius: 10px 0px;
		background: rgba(0, 0, 0, 0.30);
		color: #FFF;
		font-size: 24rpx;
		font-weight: 400;
		display: flex;
		align-items: center;
		justify-content: center;
	}

	.singleMeal_box_bg {
		border-radius: 0;
		margin-bottom: 0;

		.list_border {
			border-radius: 110rpx;
			border: 1px solid rgba(153, 153, 153, 0.30);
			padding: 16rpx 24rpx;
			position: relative;

			.lock_icon_posi {
				position: absolute;
				right: 0;
				top: -15rpx;
			}

			.text_marleft {
				margin-left: 16rpx;
			}
		}

		.text_img {
			width: 40rpx;
			height: 40rpx;
			border-radius: 20rpx;

		}

		&:first-child {
			// border-radius: 20px 20px 0 0 !important;
			box-shadow: 0px -4px 10px 0px rgba(1, 33, 18, 0);
		}

		&:last-child {
			padding-bottom: 60rpx;
		}
	}

	.text48 {
		font-size: 48rpx;
	}

	.ms_test {
		width: 100vw;
		background-color: rgba(51, 51, 51, 0.50);
		z-index: 3;
		color: #fff;
		position: absolute;
		bottom: 0;
		left: 0;
	}

	.navBtn {
		@include centBox(152rpx, 56rpx, rgba(153, 153, 153, 0.5));
		border-radius: 56rpx;
		color: #fff;
	}

	.recodBox {
		width: calc(100vw - 60rpx);
		border-radius: 10rpx;
		// opacity: 0.3;
		// background: rgba(235, 239, 251, 0.3);
	}

	.setBox {
		border-radius: 10rpx 10rpx 0 0;
		// background: rgba(235, 239, 251, 0.3);
	}

	.textl60 {
		font-size: 52rpx;
	}

	.nvbf {
		&:before {
			content: '';
			position: absolute;
			left: 0;
			top: 16rpx;
			width: 4rpx;
			height: 32rpx;
			background: $text-act;
		}
	}

	.mothbox {
		padding: 0 20rpx;

		.curMonth_style {
			color: #333;
			font-family: "Microsoft YaHei UI";
			font-size: 28rpx;
			font-style: normal;
			font-weight: 400;
			line-height: normal;
		}

		.yuan {
			display: inline-block;
			width: 16rpx;
			height: 16rpx;
			flex-shrink: 0;
			background-color: #B2FAB9;
			margin-right: 10rpx;
			border-radius: 50%;
		}

		.border_bootom {
			border-bottom: 1px solid rgba(0, 0, 0, 0.03);
			padding: 0 0 30rpx;
		}

		// position: absolute;
		// left: 30rpx;
		// top: 10rpx;
	}

	.swiperBox {
		width: 100%;
		min-height: 460rpx; //498-68

		&.lg {
			min-height: 550rpx;
		}
	}

	.mcalendbx {
		// position: absolute;
		// left: 0;
		// top: 86rpx;
		border-radius: 20rpx;
		width: 100%;
		// background: rgba(235, 239, 251, 0.3);
		z-index: 22;
		height: 0;
		overflow: hidden;
		// margin-bottom: 20rpx;

		&.lg {
			&.show {
				height: 622rpx; //612
			}

			.mcdbox {
				min-height: 562rpx;
				z-index: 6;
			}
		}

		.mcdbox {
			min-height: 460rpx; //498
			border-radius: 20rpx;
			// border: 1px solid rgba(153, 153, 153, 0.1);

		}

		&.show {
			min-height: 122rpx;
			height: 540rpx; //520
			// overflow: inherit;
			transition: height 0.2s ease-out;
			// animation: anshow 0 ease-in-out 0.2s forwards;
			// animation: anshow 0,0.2s,1;
			// animation-fill-mode: forwards;
		}

		@keyframes anshow {
			from {
				overflow: hidden;
			}

			to {
				overflow: inherit;
			}
		}

		.mcitm {
			width: 14.28%;
			height: 84rpx;
			display: inline-block;
		}

		.mcnum {
			margin-top: 2rpx;

			.text-bold {
				color: #333;
			}
		}

		.mcsub {
			width: 60rpx;
			height: 60rpx;
			// line-height: 61rpx;
			// background-color: rgba(235, 239, 251, 0.50);
			background-color: #fff;
			color: #999; //CFCFCF
			border-radius: 50%;
			// border:1px solid transparent;
			border: 1px solid #EBEFFB;
			// &:after {
			// 	content: '';
			// 	width: calc(100% - 1px);
			// 	height: calc(100% - 1px);
			// 	border-radius: 50%;
			// 	position: absolute;
			// 	left: 0;
			// 	top: 0;
			// 	border: 1px solid #EBEFFB;
			// 	// box-shadow: 0px 0px 10rpx 0px rgba(93, 177, 117, 0.2);
			// }

			&.ngreen {
				&:after {
					content: none;
				}

				// background: linear-gradient(138deg, #B8E4C0 14.11%, #83DD86 84.09%);
				background-color: #53A87F;
				color: #fff;
			}

			&.grey {
				content: none;
				background-color: #EAEAEA;
				color: #fff;
			}

			&.ov {
				content: none;
				background: #EAEAEA;
				color: #999;
				// .wcbox{

				// }
			}

			&.act {

				// border:4rpx solid rgba(255, 231, 14, 0.5);
				:after {
					content: '';
					width: 52rpx;
					height: 52rpx;
					border-radius: 50%;
					position: absolute;
					left: 0;
					top: 0;
					border: 4rpx solid #4CDD97;
					box-shadow: 0px 0px 10rpx 0px rgba(93, 177, 117, 0.2);
				}
			}

			&.def {
				color: #999;
				border: 1px solid #EBEFFB;
				background-color: #fff;
			}
		}

	}

	.cuIcon-round {
		color: #999;
	}

	.cuIcon-roundcheckfill {
		color: $base-color;
	}

	.centSec {
		width: 100vw;
		min-height: 300rpx;
		border-radius: 20rpx;
		background: $color-white;
		z-index: 4;
		margin-top: -10rpx;

		.cslist {
			padding: 10rpx 16rpx 0 16rpx;
		}

		.clitm {
			width: calc(33% - 12rpx);
			height: 362rpx;
			border-radius: 24rpx 24rpx 10rpx 10rpx;
			border: 1px solid #F7F7F7;
			background: $color-white;
			margin-left: 10rpx;
			// &:nth-child(2n) {
			// 	margin-right: 0;
			// 	margin-left: 2rpx;
			// }
		}

		.climgbx,
		.climg {
			width: 100%;
			height: 200rpx;
		}

		.climg {
			border-radius: 24rpx 24rpx 0px 0px;
		}

		.csbtnbx {
			min-height: 60rpx;
		}



		.csdian {
			padding: 0 6rpx;
		}
	}

	.cstip {

		&:before,
		&:after {
			content: '';
			display: inline-block;
			position: relative;
			width: 34rpx;
			height: 23rpx;
			border-radius: 23rpx;
			opacity: 0.5;
			background: linear-gradient(90deg, rgba(137, 184, 61, 0.03) 0%, rgba(44, 172, 88, 0.50) 100%);
			z-index: 1;
		}

		&:after {
			left: -18rpx;
			z-index: 2;
		}

		&.right {
			margin-left: 18rpx;

			&:before,
			&:after {
				background: linear-gradient(90deg, rgba(44, 172, 88, 0.50) 0%, rgba(137, 184, 61, 0.03) 100%);
			}
		}
	}

	.csline {
		line-height: 50rpx;

		// height: 5rpx;
		&:before {
			content: '';
			display: inline-block;
			width: 32rpx;
			height: 5rpx;
			border-radius: 5rpx;
			background: #333;
		}
	}

	.cstit {
		padding: 20rpx;
	}

	.bot_padbox {
		height: 356rpx;
	}

	//底部模块-s
	.meal_botbx {
		position: fixed;
		width: calc(100vw - 40rpx);
		height: 336rpx;
		left: 20rpx;
		bottom: 0;
		z-index: 66; //66

		&.lowz {
			z-index: 3;
		}
	}

	.bot_main {
		&.scemt {
			.bmtbox {
				padding-top: 20rpx;
			}

			.btitm {
				// background: #8D8D8D;
			}

			.btimg {
				border: none;
				background: #8D8D8D;
			}

			.btcont {
				background: #6A6A6A;
			}

			.bmbot {
				background: #8D8D8D !important;
			}

		}
	}

	.shuline {
		&::after {
			content: '';
			width: 3rpx;
			height: 130rpx;
			position: absolute;
			// @include baseab(3rpx,100rpx);
			opacity: 0.5;
			background: linear-gradient(180deg, rgba(0, 0, 0, 0.00) 0%, rgba(255, 255, 255, 0.46) 46.5%, rgba(0, 0, 0, 0.00) 88.58%);
			right: 150rpx;
			top: 11rpx; //80
			z-index: 2;
		}

		&.hdl::after {
			content: none;
		}
	}

	.bot_scr {
		height: 130rpx;
		width: calc(100vw - 210rpx);



		.btitm {
			display: inline-block;
			margin: 16rpx 30rpx 0 0;

		}

		.btitm,
		.btimg {
			width: 92rpx;
			height: 92rpx;
		}

		.btimg {
			border-radius: 10rpx;
			border: 1px solid $base-color;
		}

		.btmsbx {
			// width: 100%;
			// position: absolute;
			// height: 30rpx;
			@include baseab(100%, 30rpx);
			left: 0;
			bottom: -10rpx;
			z-index: 1;
		}

		.btcont {
			min-width: 64rpx;
			height: 30rpx;
			line-height: 31rpx;
			border-radius: 30rpx;
			background: $base-color;

			&.kx {
				color: $base-color;
				border: 1px solid $base-color;
				background: #FFF;
			}
		}

		.bttip {
			@include baseab(28rpx, 28rpx);
			border-radius: 50%;
			background: #fff;
			top: -10rpx;
			right: -10rpx;

		}
	}

	.fcon-a-close {
		font-size: 20rpx;
	}

	.tmlef {
		&::after {
			content: '';
			width: 3rpx;
			height: 100%;
			position: absolute;
			// @include baseab(3rpx,100rpx);
			opacity: 0.5;
			background: linear-gradient(180deg, rgba(0, 0, 0, 0.00) 0%, rgba(133, 133, 133, 0.46) 46.5%, rgba(0, 0, 0, 0.00) 88.58%);
			left: 0;
			top: 0;
			z-index: 2;
		}
	}

	.bmlef {
		// width: 67%;
		height: 100%;
		margin: 0 20rpx 0 20rpx;
		display: flex;
		align-items: center;

		.total_moneys {
			color: #FFF;
			font-size: 60rpx;
			font-weight: 700;

			.moneys_front {
				font-size: 28rpx;
				font-weight: 700;
			}

		}

		.total_reduce {
			color: #FFF;
			font-size: 24rpx;
			font-weight: 400;
			text-decoration: line-through;
			margin: 30rpx 0 0 20rpx;
		}
	}

	.bot_main {
		width: 100%;
		height: 306rpx;

		.bmtop {
			height: 196rpx;
			background: #1D3E5F;
			border-radius: 40rpx 40rpx 0 0;
			padding: 10rpx 10rpx 0 10rpx;
		}

		.bmtbox {
			height: 100%;
			border-radius: 40rpx 40rpx 0 0;
			// border: 10rpx solid #040404;
			border-bottom: 0;
		}

		.bmbot {
			height: 110rpx;
			background: $base-color;
			border-radius: 0 0 40rpx 40rpx;
		}



		.bmyuan {
			font-size: 46rpx;
			width: 70rpx;
			height: 70rpx;
			line-height: 71rpx;
			border-radius: 50%;
			background: rgba(255, 255, 255, 0.2);
		}

		.bmsubbtn {
			@include centBox(202rpx, 66rpx);
			border-radius: 66rpx;
			color: $base-color;

			&.gry {
				background: #c9c9c9;
				color: #fff;
			}
		}
	}

	//底部模块-e

	//弹窗1-s
	.zm_itm {
		@include centBox(68rpx, 68rpx);
		border-radius: 50%;
		background: $base-color;
		margin: 20rpx 0 0 30rpx;

		&.kx {
			background: #fff;
			color: #999;
			border: 1px solid #999;
		}
	}

	.zm_slc {
		margin: 20rpx 40rpx 0 0;
		// margin-left: 0!important;
		// font-size: 24rpx;
		white-space: nowrap;
		vertical-align: middle;
		position: relative;
		display: inline-flex;
		align-items: center;
		justify-content: center;
		width: 306rpx;
		height: 90rpx;
		background: #F7F7F7;

		// box-sizing: border-box;
		// font-family: Microsoft YaHei, Helvetica Neue, Helvetica, sans-serif;
		&:nth-child(2n) {
			margin: 20rpx 0 0 0;
		}
	}

	.zm_half {
		width: 316rpx;
		font-size: 32rpx;
		text-align: center;
		height: 88rpx;
		line-height: 89rpx;
		// box-shadow: 0px 10px 40px rgba(76, 162, 123, 0.26);
		border-radius: 16rpx;
		cursor: pointer;
		background: #fff;
		color: #999;
		border: 1px solid #999;

		&.bg {
			color: #fff;
			background: $view-act;
		}
	}

	//弹窗1-e
	//弹窗2-s
	.pw_img {
		min-height: 300rpx;
	}

	.mimg {
		border-radius: 20rpx 20rpx 0 0;
		height: 300rpx;
	}

	.pw_litm {
		width: calc(100% - 60rpx);
		height: 90rpx;
		border-radius: 10rpx;
		background: #F7F7F7;

		&.kx {
			background: none;
			border: 1px solid #53A87F;
		}
	}

	//弹窗2-e
	// 日历扩展弹窗-s
	.calenSubFixed {
		position: absolute;
		left: 20rpx; //50 15
		width: 710rpx; //658
		// min-height: 200rpx;
		height: 0;

		z-index: 106;
		overflow: hidden;

		// &.right{
		// 	right:15rpx;
		// 	left:auto;
		// }
		// opacity: 0;
		&.show {
			// height: auto; //暂692
			// overflow: inherit;
			height: 720rpx; //暂692
			// opacity: 1;
			transition: height 0.2s ease-out;

		}

		.csb_bt {
			color: #FFFDCA;
			height: 80rpx;
			padding-right: 34rpx;
		}

		.csfmain {
			margin-top: 20rpx;
			border-radius: 10px;
			background: #80D2A7;
			padding: 10rpx 30rpx 0 30rpx;
		}

		.jtbox {
			position: absolute;
			width: 0;
			height: 0;
			align-self: center;
			position: absolute;
			border: 30rpx solid transparent;
			top: -16rpx;
			left: 50%;
			margin-left: -20rpx;
			border-top: none;
			border-bottom-color: #80D2A7;
			// border-bottom-height: 20rpx;
		}
	}

	.clm_cont {
		padding: 16rpx 30rpx 10rpx 30rpx;
		border-radius: 5px;
		background: linear-gradient(98deg, rgba(22, 129, 67, 0.20) 2.4%, rgba(22, 129, 67, 0.20) 95.9%, rgba(22, 129, 67, 0.20) 95.91%);

		.cpdmin {
			padding-bottom: 15rpx;
		}
	}

	.lock_icon {
		width: 40rpx;
		height: 40rpx;
		border-radius: 50%;
		background-color: #53A87F;
		display: flex;
		justify-content: center;
		align-items: center;
		color: #fff;
	}

	.add_menu {
		width: 100rpx;
		height: 100rpx;
		border: 1rpx dashed #FFF;
		border-radius: 10rpx;
		margin: 17rpx 0 0 34rpx;
		text-align: center;
		padding: 10rpx 0 10rpx 0;
		color: rgba(255, 255, 255, 0.70);

		.menu_add_text {
			color: rgba(255, 255, 255, 0.70);
			font-size: 20rpx;
			font-weight: 400;
			display: block;
			margin-top: 14rpx;
		}
	}

	.mores {
		color: #999;
		font-family: "Microsoft YaHei UI";
		font-size: 32rpx;
		font-style: normal;
		font-weight: 400;
		line-height: normal;
	}

	.mores_icons {
		font-size: 26rpx;
		color: #666;
		margin-left: 5rpx;
	}

	.price_text {
		color: #FC4C40;
		font-size: 32rpx;
		font-weight: 400;

		.price_text_y {
			font-size: 20rpx;
		}
	}

	.dragMain {
		// box-shadow: 0px 0px 14px 0px rgba(0, 0, 0, 0.2);
		border-radius: 40rpx;
		width: 156rpx; //120
		height: 156rpx; //120
		transition: width 0.2s ease-out;
		overflow: hidden;

		&.show {
			width: 644rpx;
			// height: 268rpx;
			height: 160rpx;

			.expend_box {
				height: 268rpx;
				background: #EBEFFB;

				// border-radius: 50%;
				.ex_top {
					width: 120rpx;
					height: 120rpx;
					border: none;
				}
			}
		}
	}

	.expend_box {
		padding: 20rpx 15rpx 20rpx 15rpx;
		width: 644rpx;
		// height:268rpx;
		// padding:20rpx 15rpx 20rpx 15rpx;
		background: none;
		// width:120rpx;
		// height: 120rpx;
		border-radius: 40rpx;
		// box-shadow: 0px 0px 13.4px 0px rgba(0, 0, 0, 0.20);
		// display: flex;
		// justify-content: space-between;
		position: relative;
		// flex-wrap: wrap;


		// &.show{
		// 	width: 644rpx;
		// 	opacity: 1;
		// 	padding:20rpx 15rpx 20rpx 15rpx;
		// 	height:268rpx;
		// 	.ex_top{
		// 		width:120rpx;
		// 		height:120rpx;
		// 		border: none;
		// 	}
		// }
		.exitem {
			width: 154rpx;
		}

		.ex_top {
			width: 112rpx;
			height: 112rpx;
			border-radius: 50%;
			background: #FF9307;
			color: #fff;
			border: 8rpx solid #fff;
			box-shadow: 0px 2px 10rpx 0px rgba(0, 0, 0, 0.3);
		}

		.an_icons {
			position: absolute;
			left: 4rpx;
			top: 37rpx;
			width: 38rpx;
			height: 38rpx;
			border-radius: 80rpx;
			background: rgba(255, 255, 255, 0.90);
			display: flex;
			justify-content: center;
			align-items: center;
		}

		.fn_toCal {
			font-family: "Microsoft YaHei UI";
			font-size: 32rpx;
			font-weight: 700;
		}

		.martmin {
			padding-top: 3rpx;
		}

		.fn_unit {
			font-family: "Microsoft YaHei UI";
			font-size: 20rpx;
			font-weight: 400;
			line-height: 1;
		}


		.oth_box {
			width: 120rpx;
			height: 120rpx;
			border-radius: 50%;
			font-family: "Microsoft YaHei UI";
			text-align: center;
			padding-top: 10rpx;
			position: relative;
			background-size: 130% 130%;
			background-position-x: -20rpx;
			background-position-y: -20rpx;

			.list_name {
				color: #333;
				font-size: 24rpx;
				font-weight: 400;
				margin-top: 12rpx;
				z-index: 1;
				line-height: 1;
			}

			.list_value {
				color: #333;
				font-size: 40rpx;
				font-weight: 700;
				z-index: 1;
				margin-top: 9rpx;
				line-height: 1;
			}
		}

		.change_box {
			min-width: 110rpx;
			height: 110rpx;
			padding: 10rpx 0;
			text-align: center;

			.ch_val {
				color: #333;
				font-family: "Microsoft YaHei UI";
				font-size: 40rpx;
				font-weight: 400;
			}

			.ch_name {
				color: #999;
				font-family: "Microsoft YaHei UI";
				font-size: 24rpx;
				font-weight: 400;
				margin-top: 10rpx;
			}
		}
	}

	.lkbox {
		width: 60rpx;
		height: 60rpx;
	}

	.lock_icon_Vimg {
		// position: absolute;
		// left: 6rpx;
		// top: 6rpx;
		width: 36rpx;
		height: 36rpx;
		border-radius: 50%;
		background-color: #53A87F;
		display: flex;
		justify-content: center;
		align-items: center;
		color: #fff;
	}

	.meal-prop-con {
		width: 526.638rpx;
		height: 377.75rpx;
		background-color: #fff;
		border-radius: 24rpx;

		.meal-title {
			color: #000;
			font-family: "Microsoft YaHei UI";
			font-size: 36rpx;
			text-align: center;
			height: 108rpx;
			font-weight: 700;
			line-height: 108rpx;
		}

		.meal-btn {
			margin: 48rpx auto;
			width: 336.484rpx;
			height: 80rpx;
			border-radius: 15rpx;
			border: 1px solid #5DB175;
			color: #5DB175;
			font-size: 32rpx;
			font-weight: 400;
		}

		.meal-text {
			color: #666;
			text-align: center;
			font-size: 32rpx;
			font-weight: 400;
			padding: 0 72rpx;

			text {
				&:first-child {
					margin-bottom: 20rpx;
				}
			}
		}
	}

	.comBotBx {
		min-height: 702rpx;
		max-height: 96vh;
		background-color: #fff !important;

		.seleIcon {
			width: 36rpx;
			height: 36rpx;
			position: absolute;
			right: 5rpx;
			bottom: 5rpx;

			.seleBgActive {
				border-bottom: 30rpx solid #53A87F !important;
			}

			.triangle {
				width: 0;
				height: 0;
				border-left: 30rpx solid transparent;
				border-bottom: 30rpx solid #D3D3D3;
				position: absolute;
			}

			.checkmark {
				position: absolute;
				top: 8rpx;
				left: 14rpx;
				width: 12rpx;
				height: 24rpx;
				border: solid #fff;
				border-width: 0 4rpx 4rpx 0;
				transform: rotate(45deg) scale(0.6);
			}

			.color33 {
				color: #333;
			}

			.fcon-xuanzhong {
				color: #fff;
				position: absolute;
				right: 10rpx;
				top: -8rpx;
				transform: rotate(-5deg);

				&:before {
					font-size: 9rpx !important;
				}
			}
		}

		.mtitle {
			color: #333;
			font-size: 40rpx;
			font-weight: 700;
			padding: 30rpx;
		}

		.marbittom {
			margin-bottom: 40rpx;
		}

		.yytips {
			position: absolute;
			width: 100%;
			height: 324.78rpx;
			flex-shrink: 0;
			z-index: 999;
			bottom: -345rpx;
			left: 0rpx;
			background-color: #fff;
			border-radius: 20rpx;
			box-shadow: 0 4rpx 20rpx rgba(0, 0, 0, 0.1);

			.yytips_li {
				border-bottom: 1px solid #f2f2f2;
				padding: 0 20rpx;
				height: 106rpx;
				align-items: center;

				.fongStyle {
					color: #333;
					font-family: "Microsoft YaHei UI";
					font-size: 16px;
					font-style: normal;
					font-weight: 400;
					line-height: normal;
				}
			}

			.yytips_li:last-child {
				border-bottom: none;
			}
		}

		.cuIcon-round {
			color: #999;
		}

		.cuIcon-roundcheckfill {
			color: $base-color;
		}

		.zdypadding {
			padding-top: 20rpx;
			padding-bottom: 40rpx;
		}

		.zm_half {
			width: 704.664rpx;
			font-size: 32rpx;
			text-align: center;
			height: 88rpx;
			line-height: 89rpx;
			// box-shadow: 0px 10px 40px rgba(76, 162, 123, 0.26);
			border-radius: 16rpx;
			cursor: pointer;
			background: #fff;
			color: #999;
			border: 1px solid #999;
			margin-top: 350rpx;

			&.bg {
				color: #fff;
				background: $view-act;
			}
		}
	}

	.nav .cu-items.curHover {
		position: relative;
	}

	.nav .cu-items {
		width: 329rpx;
		height: 130rpx;
		padding-left: 36rpx;
		padding-top: 20rpx;
		// border-bottom: 4rpx solid #F5F5F5;
		position: relative;
		border-radius: 5px;
		background: #F7F7F7;
		margin-right: 34rpx;
		margin-bottom: 30rpx;
		position: relative;

		&:nth-child(2n) {
			margin-right: 0;
		}

		&.act {
			.triangle {
				color: #4ca27b;
			}
		}
	}

	.nav .cu-items.curHover {
		// border-bottom: 6rpx solid;
		position: relative;
	}

	// 设置自动约餐弹窗
	.mealMate-con {
		min-height: 1010rpx;
		max-height: 96vh;
		border-radius: 20rpx 20rpx 0 0;
		background: #F3F3F3;
		padding: 0 26rpx 40rpx 26rpx;

		.titps-text {
			color: #999;
			font-size: 28rpx;
			margin: 20rpx auto;
			font-style: normal;
			font-weight: 400;
		}

		.titps-btn {
			width: 704.66rpx;
			height: 88rpx;
			color: #FFF;
			font-size: 32rpx;
			font-weight: 400;
			border-radius: 38rpx;
			background: #53A87F;
		}

		.meal-drop {
			border-radius: 20rpx;
			background: #FFF;
			box-shadow: 0px 2px 10px 0px rgba(0, 0, 0, 0.10);
			margin-bottom: 34rpx;

			.set_meals {
				padding: 0rpx 25rpx 30rpx 25rpx;

				.set_meals_li {
					width: 204rpx;
					height: 124rpx;
					flex-shrink: 0;
					background: #fff;
					border-radius: 10rpx;
					box-shadow: 0px 4px 40px 0px rgba(0, 0, 0, 0.08);
					padding: 0rpx 17rpx;
					margin-right: 19rpx;
					margin-bottom: 30rpx;
					border: 1px solid #fff;
					box-sizing: border-box;
					position: relative;
				}

				.posi-icon {
					position: absolute;
					bottom: 0;
					right: -1px;
					border-radius: 10rpx 0px;
					border: 1px solid #53A87F;
					background: #53A87F;
					width: 30.363rpx;
					height: 26.254rpx;
					padding-left: 5rpx;

					.posi-check {
						display: block;
						margin-top: 5rpx;
						font-size: 15rpx;
						color: #fff;
					}
				}

				.meals_font {
					color: #333;
					font-size: 32rpx !important;
					font-weight: 400;
				}

				.mealsfonthover {
					color: #53A87F !important;
					font-weight: 700 !important;
				}

				.textfonthover {
					color: #53A87F !important;
				}

				.text-mels {
					color: rgba(153, 153, 153, 0.70);
					font-size: 24rpx;
					font-weight: 400;
					margin-top: 8rpx;
				}

				.set_meals_li:nth-child(3n) {
					margin-right: 0rpx;
				}

				.hoverSet {
					background-image: url('https://cdn-static.yekjx.com/food/ico/images/crod_bg01.png');
					background-size: cover;
					background-repeat: no-repeat;
					border: 1px solid #53A87F !important;
				}

				.meals_font {
					color: #333;
					font-family: "Microsoft YaHei UI";
					font-size: 30rpx;
					font-weight: 400;
				}

				.csico {
					margin-left: 10rpx;
				}
			}

			.dizhi-bg {
				padding: 14rpx 0 0 20rpx;
				height: 102rpx;
				border-radius: 20rpx 20rpx 0 0;
				background: linear-gradient(180deg, #E4FEEE 50%, #FFF 93.61%);
				color: #333;
				font-size: 32rpx;
				font-weight: 400;

				.textdizhi {
					position: relative;
					padding-left: 30rpx;

					&:before {
						content: '';
						width: 6rpx;
						height: 80%;
						background-color: #53A87F;
						position: absolute;
						left: 0;
						top: 50%;
						transform: translateY(-50%);
					}
				}
			}

			.dizhi-con {
				padding: 0 26rpx 20rpx 20rpx;

				.dzhi-font {
					color: #333;
					font-size: 32rpx;
					font-weight: 400;
				}

				.dzhi-font99 {
					color: #999;
					font-size: 28rpx;
					font-weight: 400;
				}

				.marbom {
					margin-bottom: 10rpx;
				}
			}
		}

		.mate-title {
			height: 134rpx;

			text {
				&:last-child {
					color: #999;
					font-size: 32rpx;
					font-weight: 400;
				}

				&:first-child {
					color: #333;
					font-size: 40rpx;
					font-weight: 700;
				}
			}
		}
	}

	.con-li {
		display: flex;
		position: relative;
		min-height: 70rpx;

		&.padr16 {
			padding-right: 160rpx;
		}

		.padr12 {
			padding-right: 120rpx;
		}

		.title {
			color: #333;
			// font-feature-settings: 'clig' off, 'liga' off;
			// font-family: "Microsoft YaHei UI";
			font-size: 40rpx;
			// font-style: normal;
			// font-weight: 400;
		}


		.right {
			position: absolute;
			top: 50%;
			right: 0rpx;
			transform: translateY(-50%);
		}

		.name {
			padding: 6rpx 22rpx;
			border-radius: 5rpx;
			background: #EBFEF3;
			text-align: center;
			// margin-left: 15rpx;
			font-size: 24rpx;
			color: #333;
			display: inline-block;
			position: relative;
			vertical-align: middle;
			// top: -3rpx;
			margin-top: -10rpx;
		}
	}

	.goods_removeds {
		width: 100%;
		height: 40rpx;
		position: absolute;
		bottom: 0;
		left: 0;
		line-height: 40rpx;
		border-radius: 0px 0px 26rpx 26rpx;
		background: rgba(0, 0, 0, 0.50);
		color: #fff;
		font-size: 28rpx;
	}

	.goods_removeds_text {
		width: 100%;
		height: 100%;
		position: absolute;
		bottom: 0;
		left: 0;
		border-radius: 92px;
		background: rgba(0, 0, 0, 0.50);
		color: #fff;
		font-size: 28rpx;
		display: flex;
		justify-content: center;
		align-items: center;
	}
</style>